From 545be58e40562b71dae98a6e7dfccdfe2a8dbf7d Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 7 Nov 2016 09:15:04 +0100 Subject: [PATCH] Issue #454 pass our window id along in the change active window request --- include/view.h | 6 ++++++ source/dialogs/window.c | 2 +- source/view.c | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/view.h b/include/view.h index 89b692f6..8c9c7dfc 100644 --- a/include/view.h +++ b/include/view.h @@ -207,6 +207,12 @@ void rofi_view_workers_initialize ( void ); * Stop all threads and free the resources used by the threadpool */ void rofi_view_workers_finalize ( void ); +/** + * Get the handle of the main window. + * + * @returns the xcb_window_t for rofi's view or XCB_WINDOW_NONE. + */ +xcb_window_t rofi_view_get_window ( void ); /**@}*/ #endif diff --git a/source/dialogs/window.c b/source/dialogs/window.c index e425aa00..12de5ced 100644 --- a/source/dialogs/window.c +++ b/source/dialogs/window.c @@ -600,7 +600,7 @@ static ModeMode window_mode_result ( Mode *sw, int mretv, G_GNUC_UNUSED char **i // Activate the window xcb_ewmh_request_change_active_window ( &xcb->ewmh, xcb->screen_nbr, rmpd->ids->array[selected_line], XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER, - XCB_CURRENT_TIME, XCB_WINDOW_NONE ); + XCB_CURRENT_TIME, rofi_view_get_window() ); xcb_flush ( xcb->connection ); } } diff --git a/source/view.c b/source/view.c index df5ee606..82c37859 100644 --- a/source/view.c +++ b/source/view.c @@ -1631,3 +1631,8 @@ void rofi_view_switch_mode ( RofiViewState *state, Mode *mode ) rofi_view_refilter ( state ); rofi_view_update ( state ); } + +xcb_window_t rofi_view_get_window ( void ) +{ + return CacheState.main_window; +}