-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Wayland support #198
Wayland support #198
Conversation
src/procman.cpp
Outdated
GdkMonitor *monitor = gdk_display_get_monitor_at_window(gdk_display_get_default(), gtk_widget_get_window(pd->app)); | ||
GdkRectangle srect; | ||
gdk_monitor_get_workarea(monitor, &srect); | ||
|
||
swidth = srect.width; | ||
sheight = srect.height; |
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.
Use gtkmm's classes like Gdk::Monitor for getting the workarea of the monitor in which the application window is located.
sheight = HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())); | ||
Gdk::Rectangle srect; | ||
Gtk::Widget *app = Glib::wrap(pd->app); | ||
Glib::RefPtr<Gdk::Window> window = app ? app->get_window() : Glib::RefPtr<Gdk::Window>(); |
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.
Note that pd->app
is null initially, but get_monitor_at_window()
is null-safe.
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.
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.
Perhaps you need to check/update the config height/width for the main window (CLAMP) once it has been created in create_main_window.
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.
There is no problem in retrieving the width and height values from config but they cannot be compared to the current window size as it has not yet been created. It displays a new runtime warning:
gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed
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.
Builds fine, and now will run in both x11 and Wayland, the wayland segfault (confirmed here) is gone. We do get some new warnings in terminal as others have stated:
In x11 we get the previously reported warning
(mate-system-monitor:421306): Gdk-CRITICAL **: 22:09:36.352: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed
Running under wayfire I got quite a few, but this is an OLD version of wayfire (still support layer shell though) and this was with my normal x11 mate session running on tty7 and wayfire on tty2. Note that it now RUNS, no more segfault:
(mate-system-monitor:474238): Wnck-WARNING **: 22:11:07.309: libwnck is designed to work in X11 only, no valid display found
(mate-system-monitor:474238): GLib-GObject-WARNING **: 22:11:07.309: invalid (NULL) pointer instance
(mate-system-monitor:474238): GLib-GObject-CRITICAL **: 22:11:07.309: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(mate-system-monitor:474238): GLib-GObject-WARNING **: 22:11:07.309: invalid (NULL) pointer instance
(mate-system-monitor:474238): GLib-GObject-CRITICAL **: 22:11:07.309: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(mate-system-monitor:474238): Gdk-CRITICAL **: 22:11:07.332: gdk_wayland_display_get_monitor_at_window: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
(mate-system-monitor:474238): Gdk-CRITICAL **: 22:11:07.332: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed
** (mate-system-monitor:474238): WARNING **: 22:11:07.386: SELinux was found but is not enabled.
Any news on this? |
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.
Code looks reasonable and works for me on Mir and Sway on Ubuntu 20.04
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.
It runs under wayland and X11 but it creates new warnings.
Under X11:
[rave@mother ~]$ mate-system-monitor
(mate-system-monitor:26764): Gdk-CRITICAL **: 18:15:48.588: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed
Under wayfire:
[rave@f32 ~]$ mate-system-monitor
(mate-system-monitor:2188): Wnck-WARNING **: 18:19:19.404: libwnck is designed to work in X11 only, no valid display found
(mate-system-monitor:2188): GLib-GObject-WARNING **: 18:19:19.404: invalid (NULL) pointer instance
(mate-system-monitor:2188): GLib-GObject-CRITICAL **: 18:19:19.404: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(mate-system-monitor:2188): GLib-GObject-WARNING **: 18:19:19.404: invalid (NULL) pointer instance
(mate-system-monitor:2188): GLib-GObject-CRITICAL **: 18:19:19.405: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(mate-system-monitor:2188): Gdk-CRITICAL **: 18:19:19.424: gdk_wayland_display_get_monitor_at_window: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
(mate-system-monitor:2188): Gdk-CRITICAL **: 18:19:19.424: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed
Can those warnings be fixed please?
With version from master i don't get any warning under X11.
And yes, it uses libwnck3 for some reasons, this needs to be decoupled for wayland. |
Already done here 80640c9 |
This PR addresses two usages of non-portable APIs that resulted in segfaults when run under Wayland.
Note that while technically libwnck is intended to support X11 only, the remaining usages of it work as expected.