mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Fix #81, this should now work correctly.
* Put old (broken) simpleswitcher code back. * Fix call to window_get_prop * Translate address with XTranslateCoordinates.
This commit is contained in:
parent
20dca49a22
commit
10322b45a5
1 changed files with 22 additions and 5 deletions
|
@ -615,6 +615,23 @@ void monitor_active ( workarea *mon )
|
||||||
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
|
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
Window id;
|
||||||
|
Atom type;
|
||||||
|
int count;
|
||||||
|
if ( window_get_prop ( root, netatoms[_NET_ACTIVE_WINDOW], &type, &count, &id, sizeof ( Window ) )
|
||||||
|
&& type == XA_WINDOW && count > 0 ) {
|
||||||
|
XWindowAttributes *attr = window_get_attributes ( id );
|
||||||
|
if ( attr != NULL ) {
|
||||||
|
Window junkwin;
|
||||||
|
if ( XTranslateCoordinates ( display, id, attr->root,
|
||||||
|
-attr->border_width,
|
||||||
|
-attr->border_width,
|
||||||
|
&x, &y, &junkwin ) == True ) {
|
||||||
|
monitor_dimensions ( screen, x, y, mon );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( pointer_get ( root, &x, &y ) ) {
|
if ( pointer_get ( root, &x, &y ) ) {
|
||||||
monitor_dimensions ( screen, x, y, mon );
|
monitor_dimensions ( screen, x, y, mon );
|
||||||
return;
|
return;
|
||||||
|
@ -930,7 +947,7 @@ typedef struct MenuState
|
||||||
// Return state
|
// Return state
|
||||||
int *selected_line;
|
int *selected_line;
|
||||||
MenuReturn retv;
|
MenuReturn retv;
|
||||||
char **lines;
|
char **lines;
|
||||||
}MenuState;
|
}MenuState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1185,12 +1202,12 @@ static void menu_keyboard_navigation ( MenuState *state, KeySym key, unsigned in
|
||||||
state->selected = state->filtered_lines - 1;
|
state->selected = state->filtered_lines - 1;
|
||||||
state->update = TRUE;
|
state->update = TRUE;
|
||||||
}
|
}
|
||||||
else if ( key == XK_space && (modstate & ControlMask ) == ControlMask ) {
|
else if ( key == XK_space && ( modstate & ControlMask ) == ControlMask ) {
|
||||||
// If a valid item is selected, return that..
|
// If a valid item is selected, return that..
|
||||||
if ( state->selected < state->filtered_lines && state->filtered[state->selected] != NULL ) {
|
if ( state->selected < state->filtered_lines && state->filtered[state->selected] != NULL ) {
|
||||||
textbox_text( state->text, state->lines[state->line_map[state->selected]] );
|
textbox_text ( state->text, state->lines[state->line_map[state->selected]] );
|
||||||
textbox_cursor_end( state->text );
|
textbox_cursor_end ( state->text );
|
||||||
state->update = TRUE;
|
state->update = TRUE;
|
||||||
state->refilter = TRUE;
|
state->refilter = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue