mate-desktop/0001-fix-xrandr-Fix-virtual-screens-not-recognized-72886b6a.patch
2022-08-04 10:23:27 +08:00

55 lines
1.5 KiB
Diff

From 72886b6a61b918d376fd118cb2687b9ecd5d9ebe Mon Sep 17 00:00:00 2001
From: songchuanfei <songchuanfei@kylinos.com.cn>
Date: Tue, 10 Nov 2020 13:43:05 +0800
Subject: [PATCH] fix[xrandr]: Fix virtual screens not recognized
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复无法通过hotplug_mode_update属性区分虚拟屏幕的问题
---
libmate-desktop/mate-rr.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/libmate-desktop/mate-rr.c b/libmate-desktop/mate-rr.c
index ed2607e..36b0fc0 100644
--- a/libmate-desktop/mate-rr.c
+++ b/libmate-desktop/mate-rr.c
@@ -1206,22 +1206,24 @@ read_edid_data (MateRROutput *output, int *len)
static gboolean check_hotplug_mode_update(MateRROutput *output)
{
#ifdef HAVE_RANDR
+ GdkDisplay *display;
Atom atom;
- int len;
- guint8 *result;
+ XRRPropertyInfo *info = NULL;
atom = XInternAtom(DISPLAY(output), "hotplug_mode_update", FALSE);
if (atom == None)
return FALSE;
- result = get_property (DISPLAY (output),
- output->id, atom, &len);
- if (result) {
- g_free(result);
- return TRUE;
- } else
- return FALSE;
+ display = gdk_display_get_default ();
+ gdk_x11_display_error_trap_push (display);
+ info = XRRQueryOutputProperty (DISPLAY(output), output->id, atom);
+ gdk_x11_display_error_trap_pop_ignored (display);
+ if (info) {
+ XFree(info);
+ return TRUE;
+ }
+ return FALSE;
#else
return FALSE;
#endif
--
2.18.4