summaryrefslogtreecommitdiffstats
path: root/source/dialogs
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-04-26 07:52:29 +0200
committerDave Davenport <qball@gmpclient.org>2016-04-26 07:52:29 +0200
commit1661244407196a08796dad90bab523bd7e3169f1 (patch)
tree035db084af8defd433c3712b8152840270e5a61e /source/dialogs
parent85aeffbd246a088f970af3a662ebcb6fdecf7136 (diff)
Issue: 386: Fix getting desktop number property
Diffstat (limited to 'source/dialogs')
-rw-r--r--source/dialogs/window.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index 14e85581..d1cedb3d 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -469,19 +469,19 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
( ( c->title != NULL ) ? strlen ( c->title ) : 0 ) + ( c->class ? strlen ( c->class ) : 0 ) + classfield + 50;
char *line = g_malloc ( len );
if ( !pd->config_i3_mode ) {
- unsigned int wmdesktop = 0;
+ uint32_t wmdesktop = 0;
// find client's desktop.
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *r;
cookie =
- xcb_get_property ( xcb->connection, 0, c->window, xcb->ewmh._NET_WM_DESKTOP, XCB_GET_PROPERTY, 0,
- sizeof ( unsigned int ) );
+ xcb_get_property ( xcb->connection, 0, c->window, xcb->ewmh._NET_WM_DESKTOP, XCB_ATOM_CARDINAL, 0,
+ 1 );
r = xcb_get_property_reply ( xcb->connection, cookie, NULL );
- if ( r && r->type == XCB_ATOM_INTEGER ) {
- wmdesktop = *( (int *) xcb_get_property_value ( r ) );
+ if ( r && r->type == XCB_ATOM_CARDINAL ) {
+ wmdesktop = *( (uint32_t *) xcb_get_property_value ( r ) );
}
- if ( r && r->type != XCB_ATOM_INTEGER ) {
+ if ( r && r->type != XCB_ATOM_CARDINAL) {
// Assume the client is on all desktops.
wmdesktop = 0xFFFFFFFF;
}
@@ -493,7 +493,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
free ( r );
if ( wmdesktop < 0xFFFFFFFF ) {
- snprintf ( desktop, 5, "%d", (int) wmdesktop );
+ snprintf ( desktop, 5, "%u", (uint32_t) wmdesktop );
}
snprintf ( line, len, pattern, desktop, c->class ? c->class : "", c->title ? c->title : "" );