summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-06-28 17:15:09 +0200
committerraveit65 <[email protected]>2018-06-29 21:28:50 +0200
commit6bad8637b8f3f16fe84a68464842f49a4d038300 (patch)
tree3675fb361b14cab29a8c69aac5a62f9f05574624
parent7c63f614dd5dcb4fe673217dccd82fe820a214f7 (diff)
downloadmate-panel-6bad8637b8f3f16fe84a68464842f49a4d038300.tar.bz2
mate-panel-6bad8637b8f3f16fe84a68464842f49a4d038300.tar.xz
na-tray-child: replace deprecated gdk_error_trap_push/pop functions
-rw-r--r--applets/notification_area/system-tray/na-tray-child.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/applets/notification_area/system-tray/na-tray-child.c b/applets/notification_area/system-tray/na-tray-child.c
index 47a45e90..d2bf4ba7 100644
--- a/applets/notification_area/system-tray/na-tray-child.c
+++ b/applets/notification_area/system-tray/na-tray-child.c
@@ -442,6 +442,7 @@ na_tray_child_new (GdkScreen *screen,
{
XWindowAttributes window_attributes;
Display *xdisplay;
+ GdkDisplay *display;
NaTrayChild *child;
GdkVisual *visual;
gboolean visual_has_alpha;
@@ -457,10 +458,11 @@ na_tray_child_new (GdkScreen *screen,
* the socket in the same visual.
*/
- gdk_error_trap_push ();
+ display = gdk_screen_get_display (screen);
+ gdk_x11_display_error_trap_push (display);
result = XGetWindowAttributes (xdisplay, icon_window,
&window_attributes);
- gdk_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (display);
if (!result) /* Window already gone */
return NULL;
@@ -510,7 +512,7 @@ na_tray_child_get_title (NaTrayChild *child)
utf8_string = gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING");
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_NAME");
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (display);
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
child->icon_window,
@@ -520,7 +522,7 @@ na_tray_child_get_title (NaTrayChild *child)
&type, &format, &nitems,
&bytes_after, (guchar **)&val);
- if (gdk_error_trap_pop () || result != Success)
+ if (gdk_x11_display_error_trap_pop (display) || result != Success)
return NULL;
if (type != utf8_string ||
@@ -606,11 +608,15 @@ na_tray_child_force_redraw (NaTrayChild *child)
* icon is expecting the server to clear-to-background before
* the redraw. It should be ok for GtkStatusIcon or EggTrayIcon.
*/
- Display *xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget));
+ GdkDisplay *display;
+ Display *xdisplay;
XEvent xev;
GdkWindow *plug_window;
GtkAllocation allocation;
+ display = gtk_widget_get_display (widget);
+ xdisplay = GDK_DISPLAY_XDISPLAY (display);
+
plug_window = gtk_socket_get_plug_window (GTK_SOCKET (child));
gtk_widget_get_allocation (widget, &allocation);
@@ -622,8 +628,8 @@ na_tray_child_force_redraw (NaTrayChild *child)
xev.xexpose.height = allocation.height;
xev.xexpose.count = 0;
- gdk_error_trap_push ();
- XSendEvent (GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget)),
+ gdk_x11_display_error_trap_push (display);
+ XSendEvent (xdisplay,
xev.xexpose.window,
False, ExposureMask,
&xev);
@@ -631,7 +637,7 @@ na_tray_child_force_redraw (NaTrayChild *child)
* since that is asynchronous.
*/
XSync (xdisplay, False);
- gdk_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (display);
#else
/* Hiding and showing is the safe way to do it, but can result in more
* flickering.
@@ -668,14 +674,16 @@ _get_wmclass (Display *xdisplay,
char **res_class,
char **res_name)
{
+ GdkDisplay *display;
XClassHint ch;
ch.res_name = NULL;
ch.res_class = NULL;
- gdk_error_trap_push ();
+ display = gdk_display_get_default ();
+ gdk_x11_display_error_trap_push (display);
XGetClassHint (xdisplay, xwindow, &ch);
- gdk_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (display);
if (res_class)
*res_class = NULL;