Skip to content

Fix sway+nvidia confirmation dialog (#4481)#4485

Merged
svartkanin merged 2 commits intoarchlinux:masterfrom
Softer:fix-issue-4481-sway-nvidia-confirmation
Apr 28, 2026
Merged

Fix sway+nvidia confirmation dialog (#4481)#4485
svartkanin merged 2 commits intoarchlinux:masterfrom
Softer:fix-issue-4481-sway-nvidia-confirmation

Conversation

@Softer
Copy link
Copy Markdown
Contributor

@Softer Softer commented Apr 27, 2026

Closes #4481.

The Sway+Nvidia confirmation dialog had two bugs:

  1. Inverted boolean. When the user confirmed "yes, I'm okay with issues", the code reverted the driver to the previous selection instead of keeping the chosen Nvidia driver. The user got the opposite of what they confirmed.

  2. False-positive warning for nouveau. The warning triggered for any Nvidia driver, including NvidiaOpenSource (nouveau), which is the open-source Mesa driver officially supported by Sway. Users selecting nouveau got a misleading warning that they were about to break their Sway setup.

This PR adds two methods on GfxDriver:

  • is_nvidia_proprietary() — true only for NvidiaOpenKernel (nvidia-open-dkms, proprietary userspace).
  • is_nvidia_nouveau() — true only for NvidiaOpenSource (nouveau, fully open).

The Sway warning now uses is_nvidia_proprietary() instead of is_nvidia(), so nouveau users no longer see it. The boolean check is also flipped so confirming "yes" actually keeps the driver.

is_nvidia_nouveau() is added for symmetry and future use (e.g. when other Wayland compositors get similar checks).

Two bugs in the Sway+Nvidia driver confirmation:

1. The boolean was inverted - confirming "yes, I'm okay with issues"
   reverted the driver to the previous choice instead of keeping it.

2. The warning triggered for any Nvidia driver, including the
   open-source nouveau driver which is officially supported by Sway.

Add GfxDriver.is_nvidia_proprietary() and is_nvidia_nouveau() methods
so the warning fires only for nvidia-open-dkms (proprietary userspace).
@Softer Softer requested a review from Torxed as a code owner April 27, 2026 13:57
@svartkanin
Copy link
Copy Markdown
Collaborator

But is_nvidia_nouveau is never used right now? Shall we remove that until we actually need it

Comment thread archinstall/lib/profile/profile_menu.py Outdated
).show()

if result.get_value():
if not result.get_value():
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow_skip is set to false so the user has to make a choice. You can just

return result.get_value()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collapsed the Sway+Nvidia confirmation handling into return driver if result.get_value() else preset since allow_skip=False guarantees a boolean. If you had a different shape in mind for the result.get_value() simplification, happy to iterate.

- Drop is_nvidia_nouveau() helper. It is not called anywhere yet; can
  be re-added when a consumer lands.
- Collapse the Sway+Nvidia confirmation result handling into a single
  expression now that allow_skip=False guarantees a boolean answer.
@svartkanin svartkanin merged commit 8a929f6 into archlinux:master Apr 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect menu behavior sway x nvidia

2 participants