summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/x11/red_window.cpp12
-rw-r--r--client/x11/red_window_p.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index 8f6535b9..7cdf684e 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -801,6 +801,10 @@ void RedWindow_p::win_proc(XEvent& event)
}
case KeyPress:
red_window->handle_key_press_event(*red_window, &event.xkey);
+ red_window->last_event_time = event.xkey.time;
+ XChangeProperty(x_display, red_window->_win, wm_user_time,
+ XA_CARDINAL, 32, PropModeReplace,
+ (unsigned char *)&event.xkey.time, 1);
break;
case KeyRelease: {
RedKey key = to_red_key_code(event.xkey.keycode);
@@ -829,6 +833,10 @@ void RedWindow_p::win_proc(XEvent& event)
break;
}
red_window->get_listener().on_mouse_button_press(button, state);
+ red_window->last_event_time = event.xkey.time;
+ XChangeProperty(x_display, red_window->_win, wm_user_time,
+ XA_CARDINAL, 32, PropModeReplace,
+ (unsigned char *)&event.xbutton.time, 1);
break;
}
case ButtonRelease: {
@@ -1526,6 +1534,8 @@ void RedWindow::show(int screen_id)
XDeleteProperty(x_display, _win, wm_state);
wait_parent = true;
}
+ XChangeProperty(x_display, _win, wm_user_time, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *)&last_event_time, 1);
XMapWindow(x_display, _win);
move_to_current_desktop();
_expect_parent = wait_parent;
@@ -1664,6 +1674,8 @@ void RedWindow::activate()
{
//todo: use _NET_ACTIVE_WINDOW
XSetInputFocus(x_display, _win, RevertToParent, CurrentTime);
+ /* kwin won't raise on focus */
+ XRaiseWindow(x_display, _win);
}
void RedWindow::minimize()
diff --git a/client/x11/red_window_p.h b/client/x11/red_window_p.h
index 8f14d4e7..4ad5451a 100644
--- a/client/x11/red_window_p.h
+++ b/client/x11/red_window_p.h
@@ -82,6 +82,7 @@ protected:
RedWindow *_red_window;
int _width;
int _height;
+ Time last_event_time;
};
#endif