diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-02-28 00:25:53 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-02-28 00:25:53 +0100 |
commit | 764992e4bb3cc948cdf48c1963ea74ee3cd05cd2 (patch) | |
tree | 73e6e53c15fe76fc946dfca6b6d35b432645c247 /source | |
parent | c261aa8e8929dff92e74efc9482b5ac3538147f3 (diff) |
Remove more display usage
Diffstat (limited to 'source')
-rw-r--r-- | source/dialogs/window.c | 13 | ||||
-rw-r--r-- | source/scrollbar.c | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/source/dialogs/window.c b/source/dialogs/window.c index 4090282f..ddb1bfbf 100644 --- a/source/dialogs/window.c +++ b/source/dialogs/window.c @@ -76,7 +76,6 @@ typedef struct } client; // TODO extern xcb_connection_t *xcb_connection; -extern Display *display; // window lists typedef struct { @@ -243,7 +242,7 @@ static int client_has_window_type ( client *c, Atom type ) return 0; } -static client* window_client ( Display *display, xcb_window_t win ) +static client* window_client ( xcb_connection_t *xcb_connection, xcb_window_t win ) { if ( win == None ) { return NULL; @@ -290,7 +289,7 @@ static client* window_client ( Display *display, xcb_window_t win ) g_free ( name ); } - name = window_get_text_prop ( xcb_connection, c->window, XInternAtom ( display, "WM_WINDOW_ROLE", False ) ); + name = window_get_text_prop ( xcb_connection, c->window, netatoms[WM_WINDOW_ROLE] ); if ( name != NULL ) { snprintf ( c->role, CLIENTROLE, "%s", name ); @@ -420,7 +419,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd ) // calc widths of fields for ( i = nwins - 1; i > -1; i-- ) { - client *c = window_client ( display, wins[i] ); + client *c = window_client ( xcb_connection, wins[i] ); if ( ( c != NULL ) && !c->xattr.override_redirect && !client_has_window_type ( c, xcb_ewmh._NET_WM_WINDOW_TYPE_DOCK ) @@ -463,7 +462,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd ) Window w = pd->ids->array[i]; client *c; - if ( ( c = window_client ( display, w ) ) ) { + if ( ( c = window_client ( xcb_connection, w ) ) ) { // final line format unsigned int wmdesktop; char desktop[5]; @@ -570,10 +569,10 @@ static void window_mode_destroy ( Mode *sw ) static char *_get_display_value ( const Mode *sw, unsigned int selected_line, int *state, int get_entry ) { ModeModePrivateData *rmpd = mode_get_private_data ( sw ); - if ( window_client ( display, rmpd->ids->array[selected_line] )->demands ) { + if ( window_client ( xcb_connection, rmpd->ids->array[selected_line] )->demands ) { *state |= URGENT; } - if ( window_client ( display, rmpd->ids->array[selected_line] )->active ) { + if ( window_client ( xcb_connection, rmpd->ids->array[selected_line] )->active ) { *state |= ACTIVE; } return get_entry ? g_strdup ( rmpd->cmd_list[selected_line] ) : NULL; diff --git a/source/scrollbar.c b/source/scrollbar.c index 26627daa..9fc760d6 100644 --- a/source/scrollbar.c +++ b/source/scrollbar.c @@ -36,8 +36,6 @@ #include "x11-helper.h" #include "settings.h" -extern Display *display; - scrollbar *scrollbar_create ( short x, short y, short w, short h ) { scrollbar *sb = g_malloc0 ( sizeof ( scrollbar ) ); |