Skip to content

Commit

Permalink
window: Make cursor state update on click
Browse files Browse the repository at this point in the history
should solve #18
  • Loading branch information
bragefuglseth committed Jun 11, 2024
1 parent 10863ea commit 32c9a59
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/widgets/window/ui_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ impl imp::KpWindow {
glib::clone!(@weak self as imp, @strong device => move |_| {
if imp.show_cursor.get() && imp.running.get() {
imp.header_bar_running.add_css_class("hide-controls");

imp.hide_cursor();
}
}),
Expand All @@ -51,8 +50,12 @@ impl imp::KpWindow {

let click_gesture = gtk::GestureClick::new();
click_gesture.connect_released(glib::clone!(@weak self as imp => move |_, _, _, _| {
if imp.running.get() {
imp.header_bar_running.remove_css_class("hide-controls");
if !imp.show_cursor.get() && device.timestamp() > imp.cursor_hidden_timestamp.get() {
imp.show_cursor();

if imp.running.get() {
imp.header_bar_running.remove_css_class("hide-controls");
}
}
}));
obj.add_controller(click_gesture);
Expand Down

0 comments on commit 32c9a59

Please sign in to comment.