[PATCH] monitor: fix detect_monitors_simple()
Simon Ruderich
simon at ruderich.org
Tue Mar 25 03:24:25 CET 2014
Get the screen size from the root window.
---
src/monitor.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/monitor.c b/src/monitor.c
index e0169ec..83beae1 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -1206,12 +1206,15 @@ bool detect_monitors_xinerama(Rectangle** ret_rects, size_t* ret_count) {
// monitor detection that always works: one monitor across the entire screen
bool detect_monitors_simple(Rectangle** ret_rects, size_t* ret_count) {
+ XWindowAttributes attributes;
+ XGetWindowAttributes(g_display, g_root, &attributes);
+
*ret_count = 1;
*ret_rects = g_new0(Rectangle, 1);
(*ret_rects)->x = 0;
(*ret_rects)->y = 0;
- (*ret_rects)->width = g_screen_width;
- (*ret_rects)->height = g_screen_height;
+ (*ret_rects)->width = attributes.width;
+ (*ret_rects)->height = attributes.height;
return true;
}
--
1.8.4.rc4
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://listi.jpberlin.de/pipermail/hlwm/attachments/20140325/aa1659b6/attachment.asc>
More information about the hlwm
mailing list