diff options
author | William Wold <[email protected]> | 2019-01-26 05:51:51 -0500 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-01-29 19:09:05 +0000 |
commit | c733d206b9e389b0ff1945f0ace496b9d3ad4a10 (patch) | |
tree | 743f100f12c965b17c354b84d32863033de92b28 | |
parent | 4fe2b74e7bb8e578d68a2e6966ba096a96908ebf (diff) | |
download | mate-panel-c733d206b9e389b0ff1945f0ace496b9d3ad4a10.tar.bz2 mate-panel-c733d206b9e389b0ff1945f0ace496b9d3ad4a10.tar.xz |
panel-action-protocol: Error if used when X11 is disabled
-rw-r--r-- | mate-panel/panel-action-protocol.c | 7 | ||||
-rw-r--r-- | mate-panel/panel-action-protocol.h | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/mate-panel/panel-action-protocol.c b/mate-panel/panel-action-protocol.c index 60af7499..4661971d 100644 --- a/mate-panel/panel-action-protocol.c +++ b/mate-panel/panel-action-protocol.c @@ -24,6 +24,10 @@ #include <config.h> +#ifndef HAVE_X11 +#error file should only be built when HAVE_X11 is enabled +#endif + #include "panel-action-protocol.h" #include <gdk/gdk.h> @@ -131,6 +135,8 @@ panel_action_protocol_filter (GdkXEvent *gdk_xevent, screen = gdk_event_get_screen (event); display = gdk_screen_get_display (screen); + if (!GDK_IS_X11_DISPLAY (display)) + return GDK_FILTER_CONTINUE; window = gdk_x11_window_lookup_for_display (display, xevent->xclient.window); if (!window) return GDK_FILTER_CONTINUE; @@ -160,6 +166,7 @@ panel_action_protocol_init (void) GdkDisplay *display; display = gdk_display_get_default (); + g_assert(GDK_IS_X11_DISPLAY (display)); atom_mate_panel_action = XInternAtom (GDK_DISPLAY_XDISPLAY (display), diff --git a/mate-panel/panel-action-protocol.h b/mate-panel/panel-action-protocol.h index ceb7aaf3..3d27a124 100644 --- a/mate-panel/panel-action-protocol.h +++ b/mate-panel/panel-action-protocol.h @@ -25,6 +25,12 @@ #ifndef __PANEL_ACTION_PROTOCOL_H__ #define __PANEL_ACTION_PROTOCOL_H__ +#ifdef PACKAGE_NAME // only check HAVE_X11 if config.h has been included +#ifndef HAVE_X11 +#error file should only be included when HAVE_X11 is enabled +#endif +#endif + #include <glib.h> G_BEGIN_DECLS |