summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2017-06-01 15:08:20 +0200
committerQuentin Glidic <sardemff7+git@sardemff7.net>2017-06-01 15:08:20 +0200
commite576bc441cccd1958166b9bc121363cbfe2f5e1b (patch)
treeb030ac5deaddf0d8adc7b34b2e0702f3ab4c5a41 /source
parent48a80e3f82dc69e291060d1b1b338d60c6e4f3a6 (diff)
xcb: Hide WM discover function
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'source')
-rw-r--r--source/xcb.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/source/xcb.c b/source/xcb.c
index f2f41e3c..13dbdd6a 100644
--- a/source/xcb.c
+++ b/source/xcb.c
@@ -799,6 +799,33 @@ static void x11_create_frequently_used_atoms ( void )
}
}
+static void x11_helper_discover_window_manager ( void )
+{
+ xcb_window_t wm_win = 0;
+ xcb_get_property_cookie_t cc = xcb_ewmh_get_supporting_wm_check_unchecked ( &xcb->ewmh,
+ xcb_stuff_get_root_window () );
+
+ if ( xcb_ewmh_get_supporting_wm_check_reply ( &xcb->ewmh, cc, &wm_win, NULL ) ) {
+ xcb_ewmh_get_utf8_strings_reply_t wtitle;
+ xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name_unchecked ( &( xcb->ewmh ), wm_win );
+ if ( xcb_ewmh_get_wm_name_reply ( &( xcb->ewmh ), cookie, &wtitle, (void *) 0 ) ) {
+ if ( wtitle.strings_len > 0 ) {
+ g_debug ( "Found window manager: %s", wtitle.strings );
+ if ( g_strcmp0 ( wtitle.strings, "i3" ) == 0 ) {
+ current_window_manager = WM_I3;
+ }
+ else if ( g_strcmp0 ( wtitle.strings, "awesome" ) == 0 ) {
+ current_window_manager = WM_AWESOME;
+ }
+ else if ( g_strcmp0 ( wtitle.strings, "Openbox" ) == 0 ) {
+ current_window_manager = WM_OPENBOX;
+ }
+ }
+ xcb_ewmh_get_utf8_strings_reply_wipe ( &wtitle );
+ }
+ }
+}
+
gboolean display_setup ( GMainLoop *main_loop, NkBindings *bindings )
{
// Get DISPLAY, first env, then argument.
@@ -1089,30 +1116,3 @@ void x11_disable_decoration ( xcb_window_t window )
xcb_atom_t ha = netatoms[_MOTIF_WM_HINTS];
xcb_change_property ( xcb->connection, XCB_PROP_MODE_REPLACE, window, ha, ha, 32, 5, &hints );
}
-
-void x11_helper_discover_window_manager ( void )
-{
- xcb_window_t wm_win = 0;
- xcb_get_property_cookie_t cc = xcb_ewmh_get_supporting_wm_check_unchecked ( &xcb->ewmh,
- xcb_stuff_get_root_window () );
-
- if ( xcb_ewmh_get_supporting_wm_check_reply ( &xcb->ewmh, cc, &wm_win, NULL ) ) {
- xcb_ewmh_get_utf8_strings_reply_t wtitle;
- xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name_unchecked ( &( xcb->ewmh ), wm_win );
- if ( xcb_ewmh_get_wm_name_reply ( &( xcb->ewmh ), cookie, &wtitle, (void *) 0 ) ) {
- if ( wtitle.strings_len > 0 ) {
- g_debug ( "Found window manager: %s", wtitle.strings );
- if ( g_strcmp0 ( wtitle.strings, "i3" ) == 0 ) {
- current_window_manager = WM_I3;
- }
- else if ( g_strcmp0 ( wtitle.strings, "awesome" ) == 0 ) {
- current_window_manager = WM_AWESOME;
- }
- else if ( g_strcmp0 ( wtitle.strings, "Openbox" ) == 0 ) {
- current_window_manager = WM_OPENBOX;
- }
- }
- xcb_ewmh_get_utf8_strings_reply_wipe ( &wtitle );
- }
- }
-}