Skip to content

Commit c98a06e

Browse files
committed
fixed bug where only bar would be raised if clicked on top bar of window
1 parent fdccab3 commit c98a06e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

bugs.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/gridwm/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,13 +852,22 @@ impl GridWM {
852852
let event: XButtonPressedEvent = From::from(event);
853853

854854
// get toplevel window if child was clicked
855-
let clicked_win = if event.subwindow != 0 {
855+
let mut clicked_win = if event.subwindow != 0 {
856856
self.get_toplevel(event.subwindow)
857857
} else {
858858
event.subwindow
859859
};
860860

861861
if clicked_win != 0 {
862+
// also make it work if clicked on top window bar
863+
if let Some((&parent_win, _)) = self
864+
.win_bar_windows
865+
.iter()
866+
.find(|(_, bar_win)| **bar_win == clicked_win)
867+
{
868+
clicked_win = parent_win;
869+
}
870+
862871
unsafe {
863872
xlib::XSetInputFocus(
864873
self.display,

0 commit comments

Comments
 (0)