From: Oliver Kurth Date: Tue, 17 Mar 2020 21:36:54 +0000 (-0700) Subject: Fix crash because xerror in get_monitor_at_window X-Git-Tag: stable-11.1.0~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0da01328633ad1fe705460fc0f60b9c30ff0ea3f;p=thirdparty%2Fopen-vm-tools.git Fix crash because xerror in get_monitor_at_window Sometimes there is an x drawable error while calling get_monitor_at_window. This error can be safely ignored. --- diff --git a/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc b/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc index 7fcf9a0ba..3fad2ce31 100644 --- a/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc +++ b/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -989,9 +989,15 @@ GetMonitorWorkArea(Glib::RefPtr screen, // IN: std::vector values; NETWMStrutPartial strut = NETWMStrutPartial(); + gdk_error_trap_push(); if (monitor != screen->get_monitor_at_window(gdkWindow)) { continue; } + int err = gdk_error_trap_pop(); + if (err) { + Log("Ignore xerror in get_monitor_at_window. Error code %d", err); + continue; + } /* * The EWMH spec says that the new _NET_WM_STRUT_PARTIAL takes precedence