-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crashes on Wayland by not loading the HotkeyManager #804
Fix crashes on Wayland by not loading the HotkeyManager #804
Conversation
On Wayland, global hotkeys are often handled by the compositor instead. On sway for instance, a config file is edited to launch specific commands when a hotkey is entered. On such compositors, it should be enough to show Albert by configuring the compositor to launch "albert show" or "albert toggle" a hotkey manager in Albert itself is redundant.
Confirming problem, I just installed albert and it's crashing at startup:
|
I built Albert with this patch and it fixes the crash at startup under Sway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think letting wayland compositors handle hotkeys is the way to go for now, +1
If a future wayland protocol enables clients to map global hotkeys it can be added then.
if ( !hotkeyManager->registerHotkey(hotkey) ) | ||
qFatal("Failed to set hotkey to %s.", hotkey.toLocal8Bit().constData()); | ||
|
||
if ( !QGuiApplication::platformName().contains("wayland") ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about whether this is the right thing in all wayland environments, and I think it is. I'm not aware of a wayland protocol for requesting a hotkey from the compositor, and if there is it can be supported in a later patch.
@ManuelSchneid3r this LGTM. |
Is something holding this back? I also get albert failing to start on my sway env and I would appreciate ii if this was merged! Thanks! |
this, &SettingsWidget::changeHotkey); | ||
} else { | ||
ui.grabKeyButton_hotkey->setVisible(false); | ||
ui.label_hotkey->setVisible(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design choice:
- Just hide it
- Tell the user that it can't be done this way and that they should consult the compositor
I personally would go with option 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like a dialog when you push the button, or a tooltip on a disabled button?
Maybe it can be done separately in another merge request? I'm not sure when I have the time to continue work on this, and in the meantime it would be nice to at least solve the crashes :)
I'm not sure if this fix is missing something, but I'm running on Fedora 31 and the fix doesn't seem to work for me, I'm still seeing a core dump
Let me know if I can provide any other testing or information. |
Running into this on a fresh Fedora 31 system. Is there something holding this back from being merged? debug info
|
UPDATE 2: Building from the right branch allows albert to go through first run, but when actually trying to use it... $ albert -r
$ albert
$ coredumpctl info
UPDATE: I'm an idiot. I was in master. Had to pull the right branch.
Disregard the below. Hmm. Built albert from Still segfaults. $ albert -v
$ albert
$ coredumpctl info
I'm not smart enough to know if it is the same crash you were trying to fix or something different. |
Any news when this will merge? |
BUMP. Also having this issue on sway, installed from the OBS repo. |
Any idea when this will be merged? |
I also needed albertlauncher/plugins#21 to fix the widgetboxmodel plugin (otherwise it crashed on |
* Fix crashes on Wayland by not loading the HotkeyManager On Wayland, global hotkeys are often handled by the compositor instead. On sway for instance, a config file is edited to launch specific commands when a hotkey is entered. On such compositors, it should be enough to show Albert by configuring the compositor to launch "albert show" or "albert toggle" a hotkey manager in Albert itself is redundant. * Fix crash when exiting settings Co-authored-by: Johan Klokkhammer Helsing <johan.helsing@qt.io>
On Wayland, global hotkeys are often handled by the compositor instead. On sway
for instance, a config file is edited to launch specific commands when a hotkey
is entered.
On such compositors, it should be enough to show Albert by configuring the
compositor to launch "albert show" or "albert toggle" a hotkey manager in
Albert itself is redundant.