diff options
author | William Wold <[email protected]> | 2020-09-14 01:46:32 -0700 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-10-24 16:49:14 +0200 |
commit | a2e79313345fbe8950d6ba123cbc56113dac93b9 (patch) | |
tree | 294fe9b4a11a2bc3440f28849c5af0df8d48e272 /src/daemon/stack.c | |
parent | 0590140e672818c080eb52879afd01773b6251fe (diff) | |
download | mate-notification-daemon-a2e79313345fbe8950d6ba123cbc56113dac93b9.tar.bz2 mate-notification-daemon-a2e79313345fbe8950d6ba123cbc56113dac93b9.tar.xz |
Hide X11-specific code behind ifdefs and checks
Diffstat (limited to 'src/daemon/stack.c')
-rw-r--r-- | src/daemon/stack.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/daemon/stack.c b/src/daemon/stack.c index 4faa588..35317b6 100644 --- a/src/daemon/stack.c +++ b/src/daemon/stack.c @@ -24,11 +24,13 @@ #include "engines.h" #include "stack.h" +#ifdef HAVE_X11 #include <X11/Xproto.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xatom.h> #include <gdk/gdkx.h> +#endif // HAVE_X11 #define NOTIFY_STACK_SPACING 2 #define WORKAREA_PADDING 6 @@ -47,6 +49,7 @@ GList* notify_stack_get_windows(NotifyStack *stack) return stack->windows; } +#ifdef HAVE_X11 static gboolean get_work_area (NotifyStack *stack, GdkRectangle *rect) @@ -112,6 +115,7 @@ get_work_area (NotifyStack *stack, return TRUE; } +#endif // HAVE_X11 static void get_origin_coordinates (NotifyStackLocation stack_location, @@ -290,9 +294,19 @@ notify_stack_shift_notifications (NotifyStack *stack, guint i; guint n_wins; - get_work_area (stack, &workarea); gdk_monitor_get_geometry (stack->monitor, &monitor); - gdk_rectangle_intersect (&monitor, &workarea, &workarea); + +#ifdef HAVE_X11 + if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) + { + get_work_area (stack, &workarea); + gdk_rectangle_intersect (&monitor, &workarea, &workarea); + } + else +#endif + { // Not using X11 + workarea = monitor; + } add_padding_to_rect (&workarea); |