From 63be750c5b56f7417c42b9cbcd73fb98ccb03407 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 17 Feb 2016 00:00:41 +0100 Subject: Quick work-around fix for rofi blocking X on unavailable monitor --- include/textbox.h | 18 +++++++++--------- source/rofi.c | 4 ++-- source/view.c | 23 +++++++++++++---------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/include/textbox.h b/include/textbox.h index c321eb47..757b1c62 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -42,15 +42,15 @@ typedef struct typedef enum { - TB_AUTOHEIGHT = 1 << 0, - TB_AUTOWIDTH = 1 << 1, - TB_LEFT = 1 << 16, - TB_RIGHT = 1 << 17, - TB_CENTER = 1 << 18, - TB_EDITABLE = 1 << 19, - TB_MARKUP = 1 << 20, - TB_WRAP = 1 << 21, - TB_PASSWORD = 1 << 22, + TB_AUTOHEIGHT = 1 << 0, + TB_AUTOWIDTH = 1 << 1, + TB_LEFT = 1 << 16, + TB_RIGHT = 1 << 17, + TB_CENTER = 1 << 18, + TB_EDITABLE = 1 << 19, + TB_MARKUP = 1 << 20, + TB_WRAP = 1 << 21, + TB_PASSWORD = 1 << 22, } TextboxFlags; typedef enum diff --git a/source/rofi.c b/source/rofi.c index 6d5c8664..95e33c6c 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -749,6 +749,8 @@ int main ( int argc, char *argv[] ) } x11_setup ( display ); + main_loop_source = x11_event_source_new ( display ); + x11_event_source_set_callback ( main_loop_source, main_loop_x11_event_handler ); TICK_N ( "X11 Setup " ); // Sanity check @@ -768,8 +770,6 @@ int main ( int argc, char *argv[] ) config_parse_xresources_theme_dump (); exit ( EXIT_SUCCESS ); } - main_loop_source = x11_event_source_new ( display ); - x11_event_source_set_callback ( main_loop_source, main_loop_x11_event_handler ); // Parse the keybindings. parse_keys_abe (); TICK_N ( "Parse ABE" ); diff --git a/source/view.c b/source/view.c index 77c0c360..d6130b59 100644 --- a/source/view.c +++ b/source/view.c @@ -69,18 +69,20 @@ // What todo with these. extern Display *display; extern SnLauncheeContext *sncontext; +// FIXME: remove +gboolean main_loop_x11_event_handler ( G_GNUC_UNUSED gpointer data ); -GThreadPool *tpool = NULL; +GThreadPool *tpool = NULL; -RofiViewState *current_active_menu = NULL; -Window main_window = None; -cairo_surface_t *surface = NULL; -cairo_surface_t *fake_bg = NULL; -cairo_t *draw = NULL; -XIM xim; -XIC xic; -Colormap map = None; -XVisualInfo vinfo; +RofiViewState *current_active_menu = NULL; +Window main_window = None; +cairo_surface_t *surface = NULL; +cairo_surface_t *fake_bg = NULL; +cairo_t *draw = NULL; +XIM xim; +XIC xic; +Colormap map = None; +XVisualInfo vinfo; static char * get_matching_state ( void ) { @@ -1657,6 +1659,7 @@ void rofi_view_error_dialog ( const char *msg, int markup ) sn_launchee_context_complete ( sncontext ); } rofi_view_set_active ( state ); + main_loop_x11_event_handler ( NULL ); while ( !rofi_view_get_completed ( state ) ) { g_main_context_iteration ( NULL, TRUE ); } -- cgit v1.2.3