Skip to content
Permalink
Browse files

panel-xutils: Error if used when X11 is disabled

  • Loading branch information...
wmww authored and lukefromdc committed Jan 26, 2019
1 parent 00e26f7 commit db9a60cb179c7d34931609db20763d79dd58ad8e
Showing with 13 additions and 0 deletions.
  1. +7 −0 mate-panel/panel-xutils.c
  2. +6 −0 mate-panel/panel-xutils.h
@@ -24,6 +24,10 @@

#include "config.h"

#ifndef HAVE_X11
#error file should only be built when HAVE_X11 is enabled
#endif

#include "panel-xutils.h"

#include <glib.h>
@@ -63,6 +67,7 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
GdkDisplay *display;

g_return_if_fail (GDK_IS_WINDOW (gdk_window));
g_return_if_fail (GDK_IS_X11_DISPLAY (gdk_window_get_display (gdk_window)));

xdisplay = GDK_WINDOW_XDISPLAY (gdk_window);
window = GDK_WINDOW_XID (gdk_window);
@@ -116,6 +121,7 @@ panel_warp_pointer (GdkWindow *gdk_window,
GdkDisplay *display;

g_return_if_fail (GDK_IS_WINDOW (gdk_window));
g_return_if_fail (GDK_IS_X11_DISPLAY (gdk_window_get_display (gdk_window)));

xdisplay = GDK_WINDOW_XDISPLAY (gdk_window);
window = GDK_WINDOW_XID (gdk_window);
@@ -143,6 +149,7 @@ panel_get_real_modifier_mask (guint mask)
return mask;
}

g_return_val_if_fail (GDK_IS_X11_DISPLAY (gdk_display_get_default ()), mask);
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());

XDisplayKeycodes (display, &min_keycode, &max_keycode);
@@ -25,6 +25,12 @@
#ifndef __PANEL_XUTILS_H__
#define __PANEL_XUTILS_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>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>

0 comments on commit db9a60c

Please sign in to comment.
You can’t perform that action at this time.