Commit db08b5fb authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

panel-xutils: avoid deprecated error trap functions

parent 0aac21c5
......@@ -54,20 +54,22 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
guint32 strut,
guint32 strut_start,
guint32 strut_end)
{
Display *display;
Window window;
gulong struts [12] = { 0, };
{
GdkDisplay *display;
Display *xdisplay;
Window xwindow;
gulong struts [12] = { 0, };
g_return_if_fail (GDK_IS_WINDOW (gdk_window));
display = GDK_WINDOW_XDISPLAY (gdk_window);
window = GDK_WINDOW_XID (gdk_window);
display = gdk_window_get_display (gdk_window);
xdisplay = gdk_x11_display_get_xdisplay (display);
xwindow = gdk_x11_window_get_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:
......@@ -92,14 +94,14 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
break;
}
gdk_error_trap_push ();
XChangeProperty (display, window, net_wm_strut,
gdk_x11_display_error_trap_push (display);
XChangeProperty (xdisplay, xwindow, net_wm_strut,
XA_CARDINAL, 32, PropModeReplace,
(guchar *) &struts, 4);
XChangeProperty (display, window, net_wm_strut_partial,
XChangeProperty (xdisplay, xwindow, 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
......@@ -107,17 +109,19 @@ panel_warp_pointer (GdkWindow *gdk_window,
int x,
int y)
{
Display *display;
Window window;
GdkDisplay *display;
Display *xdisplay;
Window xwindow;
g_return_if_fail (GDK_IS_WINDOW (gdk_window));
display = GDK_WINDOW_XDISPLAY (gdk_window);
window = GDK_WINDOW_XID (gdk_window);
display = gdk_window_get_display (gdk_window);
xdisplay = gdk_x11_display_get_xdisplay (display);
xwindow = gdk_x11_window_get_xid (gdk_window);
gdk_error_trap_push ();
XWarpPointer (display, None, window, 0, 0, 0, 0, x, y);
gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_push (display);
XWarpPointer (xdisplay, None, xwindow, 0, 0, 0, 0, x, y);
gdk_x11_display_error_trap_pop_ignored (display);
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment