summaryrefslogtreecommitdiff
path: root/src
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 /src
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)
Diffstat (limited to 'src')
-rw-r--r--src/display.c20
1 files changed, 18 insertions, 2 deletions
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,