summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2004-12-28 05:55:58 +0000
committerElijah Newren <newren@src.gnome.org>2004-12-28 05:55:58 +0000
commit0bf6bffb165f926346a525cea8248f1962d39ded (patch)
tree5118f7bcf3d59e34c5c3ec9935809137647b0554
parent1ce080d733947624fc9714068724284a1abb6129 (diff)
downloadmetacity-0bf6bffb165f926346a525cea8248f1962d39ded.tar.gz
Spew warning if CurrentTime is passed to the function, but don't exit
2004-12-27 Elijah Newren <newren@gmail.com> * src/display.c (meta_display_set_input_focus_window, meta_display_focus_the_no_focus_window): Spew warning if CurrentTime is passed to the function, but don't exit prematurely. (fixes #162353)
-rw-r--r--ChangeLog9
-rw-r--r--src/display.c20
2 files changed, 26 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e68923e7..9b68475d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-12-27 Elijah Newren <newren@gmail.com>
+
+ * src/display.c (meta_display_set_input_focus_window,
+ meta_display_focus_the_no_focus_window): Spew warning if
+ CurrentTime is passed to the function, but don't exit prematurely.
+ (fixes #162353)
+
2004-12-24 Elijah Newren <newren@gmail.com>
* src/window.c (meta_window_show_menu): Don't show menu if all
@@ -59,7 +66,7 @@
Rename meta_window_visible_on_workspace to
meta_window_located_on_workspace (whether or not the window was
showing wasn't taken into account, which made "visible"
- confusing).
+ confusing). Fixes #136314.
2004-12-22 Elijah Newren <newren@gmail.com>
diff --git a/src/display.c b/src/display.c
index c17d82b5..4730b0a1 100644
--- a/src/display.c
+++ b/src/display.c
@@ -4611,7 +4611,14 @@ meta_display_set_input_focus_window (MetaDisplay *display,
gboolean focus_frame,
Time timestamp)
{
- if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_time))
+ if (timestamp == CurrentTime)
+ {
+ meta_warning ("meta_display_set_input_focus_window called with a "
+ "timestamp of 0 for window %s. This shouldn't happen!\n",
+ window->desc);
+ meta_print_backtrace ();
+ }
+ else if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_time))
return;
XSetInputFocus (display->xdisplay,
@@ -4629,8 +4636,17 @@ void
meta_display_focus_the_no_focus_window (MetaDisplay *display,
Time timestamp)
{
- if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_time))
+ if (timestamp == CurrentTime)
+ {
+ meta_warning ("meta_display_focus_the_no_focus_window called with a "
+ "timestamp of 0. This shouldn't happen!\n");
+ meta_print_backtrace ();
+ }
+ else if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_time))
+ {
+ meta_warning ("Ignoring focus request for no_focus_window since %lu is less than %lu.\n", timestamp, display->last_focus_time);
return;
+ }
XSetInputFocus (display->xdisplay,
display->no_focus_window,