diff options
author | raveit65 <[email protected]> | 2018-06-29 11:42:03 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-06-29 21:28:50 +0200 |
commit | 20ea38d6ee50a70c17c39d19049546874cc15743 (patch) | |
tree | 1cd271680f80319e995913388718f685839adf11 | |
parent | edb3e0d94cc2c0493bbf88496bf4b5ccdca03f54 (diff) | |
download | mate-panel-20ea38d6ee50a70c17c39d19049546874cc15743.tar.bz2 mate-panel-20ea38d6ee50a70c17c39d19049546874cc15743.tar.xz |
panel-xutils: replace deprecated gdk_error_trap functions
-rw-r--r-- | mate-panel/panel-xutils.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/mate-panel/panel-xutils.c b/mate-panel/panel-xutils.c index 413bd40e..821b7ead 100644 --- a/mate-panel/panel-xutils.c +++ b/mate-panel/panel-xutils.c @@ -57,19 +57,20 @@ panel_xutils_set_strut (GdkWindow *gdk_window, guint32 strut_start, guint32 strut_end) { - Display *display; + Display *xdisplay; Window window; gulong struts [12] = { 0, }; + GdkDisplay *display; g_return_if_fail (GDK_IS_WINDOW (gdk_window)); - display = GDK_WINDOW_XDISPLAY (gdk_window); + xdisplay = GDK_WINDOW_XDISPLAY (gdk_window); window = GDK_WINDOW_XID (gdk_window); if (net_wm_strut == None) - net_wm_strut = XInternAtom (display, "_NET_WM_STRUT", False); + net_wm_strut = XInternAtom (xdisplay, "_NET_WM_STRUT", False); if (net_wm_strut_partial == None) - net_wm_strut_partial = XInternAtom (display, "_NET_WM_STRUT_PARTIAL", False); + net_wm_strut_partial = XInternAtom (xdisplay, "_NET_WM_STRUT_PARTIAL", False); switch (orientation) { case PANEL_ORIENTATION_LEFT: @@ -94,14 +95,15 @@ panel_xutils_set_strut (GdkWindow *gdk_window, break; } - gdk_error_trap_push (); - XChangeProperty (display, window, net_wm_strut, + display = gdk_window_get_display (gdk_window); + gdk_x11_display_error_trap_push (display); + XChangeProperty (xdisplay, window, net_wm_strut, XA_CARDINAL, 32, PropModeReplace, (guchar *) &struts, 4); - XChangeProperty (display, window, net_wm_strut_partial, + XChangeProperty (xdisplay, window, net_wm_strut_partial, XA_CARDINAL, 32, PropModeReplace, (guchar *) &struts, 12); - gdk_error_trap_pop_ignored (); + gdk_x11_display_error_trap_pop_ignored (display); } void @@ -109,17 +111,19 @@ panel_warp_pointer (GdkWindow *gdk_window, int x, int y) { - Display *display; + Display *xdisplay; Window window; + GdkDisplay *display; g_return_if_fail (GDK_IS_WINDOW (gdk_window)); - display = GDK_WINDOW_XDISPLAY (gdk_window); + xdisplay = GDK_WINDOW_XDISPLAY (gdk_window); window = GDK_WINDOW_XID (gdk_window); - gdk_error_trap_push (); - XWarpPointer (display, None, window, 0, 0, 0, 0, x, y); - gdk_error_trap_pop_ignored (); + display = gdk_window_get_display (gdk_window); + gdk_x11_display_error_trap_push (display); + XWarpPointer (xdisplay, None, window, 0, 0, 0, 0, x, y); + gdk_x11_display_error_trap_pop_ignored (display); } guint |