diff options
author | lukefromdc <[email protected]> | 2023-06-20 01:35:12 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-07-17 02:47:28 +0200 |
commit | ce52935ec89bacd417ca6065012986e83a920f48 (patch) | |
tree | 282e8fa40b6589f831c24e9f894d8872d7d3575d /stickynotes/util.c | |
parent | 6133a03263321ab85fae9299968a8f069b3dfad5 (diff) | |
download | mate-applets-ce52935ec89bacd417ca6065012986e83a920f48.tar.bz2 mate-applets-ce52935ec89bacd417ca6065012986e83a920f48.tar.xz |
stickynotes: port to in-process for wayland
- Note that functions involving measuring or clicking on the desktop
- Are x11 only as wayland does not allow one app to access another's windows
- Fix warnings on removal of applet
- use wnck only in x11
- Cleanup X11 checks
Diffstat (limited to 'stickynotes/util.c')
-rw-r--r-- | stickynotes/util.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/stickynotes/util.c b/stickynotes/util.c index b5faf292..d13f9f41 100644 --- a/stickynotes/util.c +++ b/stickynotes/util.c @@ -57,6 +57,7 @@ xstuff_atom_get (const char *atom_name) int xstuff_get_current_workspace (GtkWindow *window) { +#ifdef GDK_WINDOWING_X11 Window root_window; Atom type = None; gulong nitems; @@ -68,8 +69,11 @@ xstuff_get_current_workspace (GtkWindow *window) GdkDisplay *gdk_display; Display *xdisplay; - root_window = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))); gdk_display = gdk_display_get_default (); + if (!GDK_IS_X11_DISPLAY (gdk_display)) + return -1; + + root_window = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))); xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display); gdk_x11_display_error_trap_push (gdk_display); @@ -93,6 +97,9 @@ xstuff_get_current_workspace (GtkWindow *window) XFree (num); return retval; +#else + return -1; +#endif } void xstuff_change_workspace (GtkWindow *window, |