summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-02-09 03:18:46 +0000
committerElijah Newren <newren@src.gnome.org>2005-02-09 03:18:46 +0000
commitfe1416c65ff6d6a13437f32c6835e0f82356a4eb (patch)
treeef80b0c5611308c0262410c2a6f05a1c3b6b1059
parent454e595ef845caf60aa02d5bcfd51711e9d3a5f4 (diff)
downloadmetacity-fe1416c65ff6d6a13437f32c6835e0f82356a4eb.tar.gz
Avoid using CurrentTime when focusing, handle it better in case we miss
2005-02-08 Elijah Newren <newren@gmail.com> Avoid using CurrentTime when focusing, handle it better in case we miss any cases. Fixes #166732. * src/window.c: (meta_window_shade): use meta_display_get_current_time_roundtrip() to ensure we have a valid timestamp, (meta_window_unshade): same * src/display.c: (meta_display_set_input_focus_window): If CurrentTime was passed, get one from the XServer in addition to throwing a warning, (meta_display_focus_the_no_focus_window): same
-rw-r--r--ChangeLog13
-rw-r--r--src/display.c2
-rw-r--r--src/window.c5
3 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 93771833..6b7a573a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2005-02-08 Elijah Newren <newren@gmail.com>
+ Avoid using CurrentTime when focusing, handle it better in case we
+ miss any cases. Fixes #166732.
+
+ * src/window.c: (meta_window_shade): use
+ meta_display_get_current_time_roundtrip() to ensure we have a
+ valid timestamp, (meta_window_unshade): same
+
+ * src/display.c: (meta_display_set_input_focus_window): If
+ CurrentTime was passed, get one from the XServer in addition to
+ throwing a warning, (meta_display_focus_the_no_focus_window): same
+
+2005-02-08 Elijah Newren <newren@gmail.com>
+
* src/window.c: (meta_window_activate): If we're not passed a
timestamp, make sure to manually get one. Fixes #166728.
diff --git a/src/display.c b/src/display.c
index f72bd599..3d8e3d2c 100644
--- a/src/display.c
+++ b/src/display.c
@@ -4660,6 +4660,7 @@ meta_display_set_input_focus_window (MetaDisplay *display,
"timestamp of 0 for window %s. This shouldn't happen!\n",
window->desc);
meta_print_backtrace ();
+ timestamp = meta_display_get_current_time_roundtrip (display);
}
else if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_time))
return;
@@ -4684,6 +4685,7 @@ meta_display_focus_the_no_focus_window (MetaDisplay *display,
meta_warning ("meta_display_focus_the_no_focus_window called with a "
"timestamp of 0. This shouldn't happen!\n");
meta_print_backtrace ();
+ timestamp = meta_display_get_current_time_roundtrip (display);
}
else if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_time))
{
diff --git a/src/window.c b/src/window.c
index 947acff3..67ff35c2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2109,7 +2109,7 @@ meta_window_shade (MetaWindow *window)
"Re-focusing window %s after shading it\n",
window->desc);
meta_window_focus (window,
- meta_display_get_current_time (window->display));
+ meta_display_get_current_time_roundtrip (window->display));
set_net_wm_state (window);
}
@@ -2130,7 +2130,8 @@ meta_window_unshade (MetaWindow *window)
meta_topic (META_DEBUG_FOCUS,
"Focusing window %s after unshading it\n",
window->desc);
- meta_window_focus (window, meta_display_get_current_time (window->display));
+ meta_window_focus (window,
+ meta_display_get_current_time_roundtrip (window->display));
set_net_wm_state (window);
}