[Xfce4-commits] r24099 - xfwm4/trunk/src
Olivier Fourdan
olivier at xfce.org
Wed Dec 13 23:01:17 CET 2006
Author: olivier
Date: 2006-12-13 22:01:17 +0000 (Wed, 13 Dec 2006)
New Revision: 24099
Modified:
xfwm4/trunk/src/client.c
xfwm4/trunk/src/client.h
xfwm4/trunk/src/display.c
xfwm4/trunk/src/display.h
xfwm4/trunk/src/events.c
xfwm4/trunk/src/events.h
xfwm4/trunk/src/focus.c
xfwm4/trunk/src/focus.h
xfwm4/trunk/src/hints.c
xfwm4/trunk/src/hints.h
xfwm4/trunk/src/main.c
xfwm4/trunk/src/misc.h
xfwm4/trunk/src/workspaces.c
xfwm4/trunk/src/workspaces.h
Log:
Fix build with -Werror, remove some useless #includes and add some others (actually, time.h and sys/time.h were not required since Time is defined in X.h anyway).
Modified: xfwm4/trunk/src/client.c
===================================================================
--- xfwm4/trunk/src/client.c 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/client.c 2006-12-13 22:01:17 UTC (rev 24099)
@@ -23,10 +23,7 @@
#include <config.h>
#endif
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
Modified: xfwm4/trunk/src/client.h
===================================================================
--- xfwm4/trunk/src/client.h 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/client.h 2006-12-13 22:01:17 UTC (rev 24099)
@@ -28,10 +28,8 @@
#include <string.h>
#include <signal.h>
#include <unistd.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
Modified: xfwm4/trunk/src/display.c
===================================================================
--- xfwm4/trunk/src/display.c 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/display.c 2006-12-13 22:01:17 UTC (rev 24099)
@@ -22,6 +22,7 @@
# include "config.h"
#endif
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
@@ -708,7 +709,6 @@
{
g_return_val_if_fail (display != NULL, (Time) CurrentTime);
- TRACE ("myDisplayGetCurrentTime gives timestamp=%u", display->current_time);
return (Time) display->current_time;
}
@@ -723,7 +723,6 @@
time = getXServerTime (display);
}
- TRACE ("myDisplayGetTime gives timestamp=%u", time);
return (time);
}
@@ -732,7 +731,6 @@
{
g_return_val_if_fail (display != NULL, (Time) CurrentTime);
- TRACE ("myDisplayGetLastUserTime gives timestamp=%u", display->last_user_time);
return (Time) display->last_user_time;
}
Modified: xfwm4/trunk/src/display.h
===================================================================
--- xfwm4/trunk/src/display.h 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/display.h 2006-12-13 22:01:17 UTC (rev 24099)
@@ -25,9 +25,7 @@
# include "config.h"
#endif
-#include <sys/time.h>
-#include <time.h>
-
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
Modified: xfwm4/trunk/src/events.c
===================================================================
--- xfwm4/trunk/src/events.c 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/events.c 2006-12-13 22:01:17 UTC (rev 24099)
@@ -24,9 +24,8 @@
#endif
#include <string.h>
-#include <sys/time.h>
-#include <time.h>
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -2082,16 +2081,19 @@
}
else if ((ev->message_type == display_info->atoms[NET_ACTIVE_WINDOW]) && (ev->format == 32))
{
+ gboolean source_is_application;
+ Time ev_time;
+
+ ev_time = myDisplayGetTime (display_info, (Time) ev->data.l[1]);
+ source_is_application = (ev->data.l[0] == 1);
+
TRACE ("client \"%s\" (0x%lx) has received a NET_ACTIVE_WINDOW event", c->name, c->window);
- if (ev->data.l[0] != 0)
+ if (source_is_application)
{
Time current = myDisplayGetLastUserTime (display_info);
- Time ev_time = (Time) ev->data.l[1];
TRACE ("Time of event received is %u, current XServer time is %u", (unsigned int) ev_time, (unsigned int) current);
- if ((screen_info->params->prevent_focus_stealing) &&
- (ev_time != (Time) CurrentTime) &&
- TIMESTAMP_IS_BEFORE(ev_time, current))
+ if ((screen_info->params->prevent_focus_stealing) && TIMESTAMP_IS_BEFORE(ev_time, current))
{
TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
@@ -2099,11 +2101,12 @@
}
else
{
- clientActivate (c, (Time) ev_time);
+ clientActivate (c, ev_time);
}
}
else
{
+ /* The request is either from a pager or an older client, use the most accurate timestamp */
clientActivate (c, getXServerTime (display_info));
}
}
@@ -2129,12 +2132,8 @@
if ((ev->data.l[0] >= 0) && (ev->data.l[0] < screen_info->workspace_count) &&
(ev->data.l[0] != screen_info->current_ws))
{
- Time ev_time = (Time) ev->data.l[1];
- if (ev_time == (Time) CurrentTime)
- {
- ev_time = getXServerTime (display_info);
- }
- workspaceSwitch (screen_info, ev->data.l[0], NULL, TRUE, ev_time);
+ workspaceSwitch (screen_info, ev->data.l[0], NULL, TRUE,
+ myDisplayGetTime (display_info, (Time) ev->data.l[1]));
}
}
else if (((ev->message_type == display_info->atoms[WIN_WORKSPACE_COUNT]) ||
Modified: xfwm4/trunk/src/events.h
===================================================================
--- xfwm4/trunk/src/events.h 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/events.h 2006-12-13 22:01:17 UTC (rev 24099)
@@ -26,8 +26,7 @@
# include "config.h"
#endif
-#include <sys/types.h>
-#include <sys/time.h>
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
Modified: xfwm4/trunk/src/focus.c
===================================================================
--- xfwm4/trunk/src/focus.c 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/focus.c 2006-12-13 22:01:17 UTC (rev 24099)
@@ -23,10 +23,7 @@
#include <config.h>
#endif
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -508,7 +505,7 @@
c2 = ((client_focus != c) ? client_focus : NULL);
if ((c) && FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
{
- TRACE ("setting focus to client \"%s\" (0x%lx) with timestamp %u", c->name, c->window, timestamp);
+ TRACE ("setting focus to client \"%s\" (0x%lx)", c->name, c->window);
user_focus = c;
if (FLAG_TEST(c->flags, CLIENT_FLAG_DEMANDS_ATTENTION))
{
Modified: xfwm4/trunk/src/focus.h
===================================================================
--- xfwm4/trunk/src/focus.h 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/focus.h 2006-12-13 22:01:17 UTC (rev 24099)
@@ -25,9 +25,8 @@
# include "config.h"
#endif
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
#include <glib.h>
#include "screen.h"
Modified: xfwm4/trunk/src/hints.c
===================================================================
--- xfwm4/trunk/src/hints.c 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/hints.c 2006-12-13 22:01:17 UTC (rev 24099)
@@ -24,9 +24,11 @@
#include <config.h>
#endif
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
+
#include <glib.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
@@ -36,6 +38,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <libxfce4util/libxfce4util.h>
+
#include "display.h"
#include "screen.h"
#include "hints.h"
@@ -1211,7 +1214,6 @@
timestamp = (Time) myDisplayUpdateCurrentTime (display_info, &xevent);
}
- TRACE ("getXServerTime gives timestamp=%u", timestamp);
return timestamp;
}
Modified: xfwm4/trunk/src/hints.h
===================================================================
--- xfwm4/trunk/src/hints.h 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/hints.h 2006-12-13 22:01:17 UTC (rev 24099)
@@ -27,9 +27,7 @@
# include "config.h"
#endif
-#include <sys/time.h>
-#include <time.h>
-
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
Modified: xfwm4/trunk/src/main.c
===================================================================
--- xfwm4/trunk/src/main.c 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/main.c 2006-12-13 22:01:17 UTC (rev 24099)
@@ -23,6 +23,7 @@
#include <config.h>
#endif
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <glib.h>
#include <gdk/gdk.h>
Modified: xfwm4/trunk/src/misc.h
===================================================================
--- xfwm4/trunk/src/misc.h 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/misc.h 2006-12-13 22:01:17 UTC (rev 24099)
@@ -23,10 +23,7 @@
# include "config.h"
#endif
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <glib.h>
#include "screen.h"
Modified: xfwm4/trunk/src/workspaces.c
===================================================================
--- xfwm4/trunk/src/workspaces.c 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/workspaces.c 2006-12-13 22:01:17 UTC (rev 24099)
@@ -23,10 +23,7 @@
#include <config.h>
#endif
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
Modified: xfwm4/trunk/src/workspaces.h
===================================================================
--- xfwm4/trunk/src/workspaces.h 2006-12-13 21:57:35 UTC (rev 24098)
+++ xfwm4/trunk/src/workspaces.h 2006-12-13 22:01:17 UTC (rev 24099)
@@ -26,10 +26,7 @@
# include "config.h"
#endif
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
More information about the Xfce4-commits
mailing list