-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow running build with X11 support under Wayland #171
base: master
Are you sure you want to change the base?
Conversation
(Theoretically there's a world where someone has compiled GTK2 with the Wayland backend, and this also fixes that) |
display = gdk_x11_get_default_xdisplay(); | ||
window = RootWindow(display, 0); | ||
} | ||
|
||
void x11_property_set(const char* key, const char* value) | ||
{ | ||
if (!display) { | ||
g_warning("x11_property_set: call has no effect on non-X sessions"); |
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.
Instead of printing warnings here, maybe we could just prevent calling these x11_property functions in the first place?
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 definitely considered this but I don't know enough to make a change confidently and didn't have time to look into it. I could probably look into it in more detail but not particularly soon.
These functions are only used to update the PULSE_SERVER
x11 property when the user selects an option under Default server
in the menu. I'm not sure (a) how to locally run multiple pulse servers or make my system aware of multiple pulse servers; (b) what the equivalent concept under wayland is.
I think the way to do what you've just described would be to not add the Server menu option when Wayland is detected, but it seemed quite complicated. Any advice?
if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) { | ||
settings->key_grabbing = FALSE; | ||
} | ||
#endif |
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.
Since you'll need this check a couple of times, would it make sense to do it once during initialization, and store the result, then check for it wherever needed?
Fixes: #90 / Ref: #156
Fixes segfaults under Wayland if built with X11 support.
Adds a warning when
-g
is used under Wayland, notifying the user that the option has no effect.Adds a warning when
x11_property
calls are made under Wayland.