summaryrefslogtreecommitdiffstats
path: root/source/rofi.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-07-13 08:21:15 +0200
committerDave Davenport <qball@gmpclient.org>2017-07-13 08:21:15 +0200
commitbca01f389ddedb5cf75930090dc440e22ccc943f (patch)
tree6a64f2c8fd81cf8ac99e1a2ddd11db2283e641d5 /source/rofi.c
parent7b579852032857d2b58e8bd07954e154e2e33021 (diff)
[DMenu] make rofi obey the dmenu -w flag.
- This is a dirty hack that needs to be done better in next release.
Diffstat (limited to 'source/rofi.c')
-rw-r--r--source/rofi.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/rofi.c b/source/rofi.c
index e19d7b86..44e2a19d 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -855,6 +855,8 @@ int main ( int argc, char *argv[] )
parse_keys_abe ( bindings );
+ /** dirty hack for dmenu compatibility */
+ char *windowid = NULL;
if ( !dmenu_mode ) {
// setup_modi
if ( setup_modi () ) {
@@ -863,7 +865,13 @@ int main ( int argc, char *argv[] )
}
TICK_N ( "Setup Modi" );
}
-
+ else {
+ // Hack for dmenu compatibility.
+ if ( find_arg_str ( "-w", &windowid ) == TRUE ) {
+ config.monitor = g_strdup_printf ( "wid:%s", windowid );
+ windowid = config.monitor;
+ }
+ }
if ( rofi_theme_is_empty ( ) ) {
if ( rofi_theme_parse_string ( default_theme ) ) {
g_warning ( "Failed to parse default theme. Giving up.." );
@@ -951,5 +959,8 @@ int main ( int argc, char *argv[] )
g_main_loop_run ( main_loop );
teardown ( pfd );
cleanup ();
+
+ /* dirty hack */
+ g_free ( windowid );
return return_code;
}