summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-02-09 22:35:03 +0100
committerDave Davenport <qball@gmpclient.org>2016-02-09 22:35:03 +0100
commit2cd8888d2cd4e9f2aaa605c025d63344757ee563 (patch)
treedd54696a80bde92d06b0245c6b04577d1e3d244e /source
parentf7e26326249a485cdeac82581a3d79fadac2e29e (diff)
parent289795b22a2ab0bf3f24e514c50f43df860f2690 (diff)
Merge remote-tracking branch 'origin/master' into glib-loop
Diffstat (limited to 'source')
-rw-r--r--source/dialogs/dmenu.c4
-rw-r--r--source/textbox.c2
-rw-r--r--source/x11-helper.c14
3 files changed, 17 insertions, 3 deletions
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c
index cd2e789d..d4c343d7 100644
--- a/source/dialogs/dmenu.c
+++ b/source/dialogs/dmenu.c
@@ -89,8 +89,8 @@ static char **get_dmenu ( FILE *fd, unsigned int *length )
data[l - 1] = '\0';
l--;
}
- if ( ! g_utf8_validate ( data, l, NULL) ) {
- fprintf(stderr, "String: '%s' is not valid utf-8\n", data);
+ if ( !g_utf8_validate ( data, l, NULL ) ) {
+ fprintf ( stderr, "String: '%s' is not valid utf-8\n", data );
continue;
}
diff --git a/source/textbox.c b/source/textbox.c
index e207c7f4..75102ec6 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -159,7 +159,7 @@ static void __textbox_update_pango_text ( textbox *tb )
pango_layout_set_attributes ( tb->layout, NULL );
pango_layout_set_text ( tb->layout, string, l );
}
- else if ( tb->flags & TB_MARKUP || tb->tbft & MARKUP ) {
+ else if ( tb->flags & TB_MARKUP || tb->tbft & MARKUP ) {
pango_layout_set_markup ( tb->layout, tb->text, -1 );
}
else {
diff --git a/source/x11-helper.c b/source/x11-helper.c
index 9c408748..b21e6ff3 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -265,6 +265,20 @@ void monitor_active ( Display *display, workarea *mon )
}
fprintf ( stderr, "Failed to find selected monitor.\n" );
}
+ // Get the current desktop.
+ unsigned long current_desktop = 0;
+ if ( window_get_cardinal_prop ( display, root, netatoms[_NET_CURRENT_DESKTOP], &current_desktop, 1 ) ) {
+ unsigned long desktops = 0;
+ if ( window_get_cardinal_prop ( display, root, netatoms[_NET_NUMBER_OF_DESKTOPS], &desktops, 1 ) ) {
+ unsigned long deskg[desktops * 2];
+ if ( window_get_cardinal_prop ( display, root, netatoms[_NET_DESKTOP_VIEWPORT], &deskg[0], desktops * 2 ) ) {
+ if ( current_desktop < desktops ) {
+ monitor_dimensions ( display, screen, deskg[current_desktop * 2], deskg[current_desktop * 2 + 1], mon );
+ return;
+ }
+ }
+ }
+ }
if ( window_get_prop ( display, root, netatoms[_NET_ACTIVE_WINDOW], &type, &count, &id, sizeof ( Window ) )
&& type == XA_WINDOW && count > 0 ) {
XWindowAttributes attr;