summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren gmail com>2006-09-13 16:32:33 +0000
committerElijah Newren <newren@src.gnome.org>2006-09-13 16:32:33 +0000
commit3b0478776df99364929cbd8db72b7dc06c24d030 (patch)
tree1efda9b27b829b44405e56448a1c53851c0159b8
parentc53538b1c26482c2cac3e209d0e77a00347feb96 (diff)
downloadmetacity-3b0478776df99364929cbd8db72b7dc06c24d030.tar.gz
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com> * src/common.h (MetaWindowMenuFunc): * src/core.[ch] (meta_core_user_lower_and_unfocus, meta_core_user_focus, meta_core_show_window_menu, meta_core_begin_grab_op, meta_core_end_grab_op): * src/delete.c (delete_ping_reply_func, delete_ping_timeout_func, meta_window_delete): * src/display.[ch] (struct MetaDisplay, struct MetaPingData, sanity_check_timestamps, meta_display_open, event_callback, meta_spew_event, meta_display_set_grab_op_cursor, meta_display_begin_grab_op, meta_display_end_grab_op, meta_display_ping_timeout, meta_display_ping_window, process_pong_message, timestamp_too_old, meta_display_set_input_focus_window): * src/keybindings.[ch] (grab_keyboard, ungrab_keyboard, meta_screen_grab_all_keys, meta_window_grab_all_keys, meta_window_ungrab_all_keys, error_on_generic_command, error_on_command, error_on_terminal_command): * src/metacity-dialog.c (on_realize, warn_about_no_sm_support, error_about_command, main): * src/screen.[ch] (struct _MetaScreen, meta_screen_new, meta_screen_show_desktop, meta_screen_apply_startup_properties): * src/session.c (warn_about_lame_clients_and_finish_interact): * src/window.[ch] (struct _MetaWindow, intervening_user_event_occurred, window_activate, meta_window_delete, meta_window_focus, meta_window_send_icccm_message, meta_window_client_message, menu_callback, meta_window_show_menu, struct EventScannerData, check_use_this_motion_notify, meta_window_begin_grab_op, meta_window_set_user_time): * src/workspace.[ch] (focus_ancestor_or_mru_window, meta_workspace_activate_with_focus, meta_workspace_activate, meta_workspace_focus_default_window, focus_ancestor_or_mru_window): Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+ does) instead of Time. #348305
-rw-r--r--ChangeLog38
-rw-r--r--src/common.h2
-rw-r--r--src/core.c10
-rw-r--r--src/core.h10
-rw-r--r--src/delete.c8
-rw-r--r--src/display.c87
-rw-r--r--src/display.h32
-rw-r--r--src/keybindings.c26
-rw-r--r--src/keybindings.h12
-rw-r--r--src/metacity-dialog.c10
-rw-r--r--src/screen.c10
-rw-r--r--src/screen.h6
-rw-r--r--src/session.c4
-rw-r--r--src/window.c58
-rw-r--r--src/window.h16
-rw-r--r--src/workspace.c10
-rw-r--r--src/workspace.h6
17 files changed, 191 insertions, 154 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a2b2b37..e1986430 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2006-09-13 Elijah Newren <newren gmail com>
+
+ * src/common.h (MetaWindowMenuFunc):
+ * src/core.[ch] (meta_core_user_lower_and_unfocus,
+ meta_core_user_focus, meta_core_show_window_menu,
+ meta_core_begin_grab_op, meta_core_end_grab_op):
+ * src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
+ meta_window_delete):
+ * src/display.[ch] (struct MetaDisplay, struct MetaPingData,
+ sanity_check_timestamps, meta_display_open, event_callback,
+ meta_spew_event, meta_display_set_grab_op_cursor,
+ meta_display_begin_grab_op, meta_display_end_grab_op,
+ meta_display_ping_timeout, meta_display_ping_window,
+ process_pong_message, timestamp_too_old,
+ meta_display_set_input_focus_window):
+ * src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
+ meta_screen_grab_all_keys, meta_window_grab_all_keys,
+ meta_window_ungrab_all_keys, error_on_generic_command,
+ error_on_command, error_on_terminal_command):
+ * src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
+ error_about_command, main):
+ * src/screen.[ch] (struct _MetaScreen, meta_screen_new,
+ meta_screen_show_desktop, meta_screen_apply_startup_properties):
+ * src/session.c (warn_about_lame_clients_and_finish_interact):
+ * src/window.[ch] (struct _MetaWindow,
+ intervening_user_event_occurred, window_activate,
+ meta_window_delete, meta_window_focus,
+ meta_window_send_icccm_message, meta_window_client_message,
+ menu_callback, meta_window_show_menu, struct EventScannerData,
+ check_use_this_motion_notify, meta_window_begin_grab_op,
+ meta_window_set_user_time):
+ * src/workspace.[ch] (focus_ancestor_or_mru_window,
+ meta_workspace_activate_with_focus, meta_workspace_activate,
+ meta_workspace_focus_default_window,
+ focus_ancestor_or_mru_window):
+ Fix issues on 64-bit machines with timestamps by using guint32
+ (like gtk+ does) instead of Time. #348305
+
2006-09-12 Elijah Newren <newren gmail com>
* src/theme.c (meta_gtk_arrow_from_string,
diff --git a/src/common.h b/src/common.h
index ca3bcdf5..f075c61e 100644
--- a/src/common.h
+++ b/src/common.h
@@ -74,7 +74,7 @@ typedef struct _MetaWindowMenu MetaWindowMenu;
typedef void (* MetaWindowMenuFunc) (MetaWindowMenu *menu,
Display *xdisplay,
Window client_xwindow,
- Time timestamp,
+ guint32 timestamp,
MetaMenuOp op,
int workspace,
gpointer data);
diff --git a/src/core.c b/src/core.c
index 64af044f..3d88f703 100644
--- a/src/core.c
+++ b/src/core.c
@@ -199,7 +199,7 @@ meta_core_user_raise (Display *xdisplay,
void
meta_core_user_lower_and_unfocus (Display *xdisplay,
Window frame_xwindow,
- Time timestamp)
+ guint32 timestamp)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
@@ -242,7 +242,7 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
void
meta_core_user_focus (Display *xdisplay,
Window frame_xwindow,
- Time timestamp)
+ guint32 timestamp)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
@@ -441,7 +441,7 @@ meta_core_show_window_menu (Display *xdisplay,
int root_x,
int root_y,
int button,
- Time timestamp)
+ guint32 timestamp)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
@@ -587,7 +587,7 @@ meta_core_begin_grab_op (Display *xdisplay,
int event_serial,
int button,
gulong modmask,
- Time timestamp,
+ guint32 timestamp,
int root_x,
int root_y)
{
@@ -609,7 +609,7 @@ meta_core_begin_grab_op (Display *xdisplay,
void
meta_core_end_grab_op (Display *xdisplay,
- Time timestamp)
+ guint32 timestamp)
{
MetaDisplay *display;
diff --git a/src/core.h b/src/core.h
index b361550e..574929d0 100644
--- a/src/core.h
+++ b/src/core.h
@@ -66,11 +66,11 @@ void meta_core_user_raise (Display *xdisplay,
Window frame_xwindow);
void meta_core_user_lower_and_unfocus (Display *xdisplay,
Window frame_xwindow,
- Time timestamp);
+ guint32 timestamp);
void meta_core_user_focus (Display *xdisplay,
Window frame_xwindow,
- Time timestamp);
+ guint32 timestamp);
/* get position of client, same coord space expected by move */
void meta_core_get_position (Display *xdisplay,
@@ -127,7 +127,7 @@ void meta_core_show_window_menu (Display *xdisplay,
int root_x,
int root_y,
int button,
- Time timestamp);
+ guint32 timestamp);
void meta_core_get_menu_accelerator (MetaMenuOp menu_op,
int workspace,
@@ -141,11 +141,11 @@ gboolean meta_core_begin_grab_op (Display *xdisplay,
int event_serial,
int button,
gulong modmask,
- Time timestamp,
+ guint32 timestamp,
int root_x,
int root_y);
void meta_core_end_grab_op (Display *xdisplay,
- Time timestamp);
+ guint32 timestamp);
MetaGrabOp meta_core_get_grab_op (Display *xdisplay);
Window meta_core_get_grab_frame (Display *xdisplay);
int meta_core_get_grab_button (Display *xdisplay);
diff --git a/src/delete.c b/src/delete.c
index 3cbf78d0..01996bf2 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -39,7 +39,7 @@ static void meta_window_present_delete_dialog (MetaWindow *window);
static void
delete_ping_reply_func (MetaDisplay *display,
Window xwindow,
- Time timestamp,
+ guint32 timestamp,
void *user_data)
{
meta_topic (META_DEBUG_PING,
@@ -292,7 +292,7 @@ io_from_ping_dialog (GIOChannel *channel,
static void
delete_ping_timeout_func (MetaDisplay *display,
Window xwindow,
- Time timestamp,
+ guint32 timestamp,
void *user_data)
{
MetaWindow *window = user_data;
@@ -318,7 +318,7 @@ delete_ping_timeout_func (MetaDisplay *display,
window_id_str = g_strdup_printf ("0x%lx", window->xwindow);
sprintf (numbuf, "%d", window->screen->number);
- sprintf (timestampbuf, "%lu", timestamp);
+ sprintf (timestampbuf, "%u", timestamp);
argv[0] = METACITY_LIBEXECDIR"/metacity-dialog";
argv[1] = "--screen";
@@ -364,7 +364,7 @@ delete_ping_timeout_func (MetaDisplay *display,
void
meta_window_delete (MetaWindow *window,
- Time timestamp)
+ guint32 timestamp)
{
meta_error_trap_push (window->display);
if (window->delete_window)
diff --git a/src/display.c b/src/display.c
index 8a483f02..9c69d183 100644
--- a/src/display.c
+++ b/src/display.c
@@ -76,12 +76,12 @@
typedef struct
{
MetaDisplay *display;
- Window xwindow;
- Time timestamp;
+ Window xwindow;
+ guint32 timestamp;
MetaWindowPingFunc ping_reply_func;
MetaWindowPingFunc ping_timeout_func;
- void *user_data;
- guint ping_timeout_id;
+ void *user_data;
+ guint ping_timeout_id;
} MetaPingData;
typedef struct
@@ -116,7 +116,7 @@ static void prefs_changed_callback (MetaPreference pref,
void *data);
static void sanity_check_timestamps (MetaDisplay *display,
- Time known_good_timestamp);
+ guint32 known_good_timestamp);
MetaGroup* get_focussed_group (MetaDisplay *display);
@@ -233,7 +233,7 @@ meta_display_open (void)
GSList *screens;
GSList *tmp;
int i;
- Time timestamp;
+ guint32 timestamp;
/* Remember to edit code that assigns each atom to display struct
* when adding an atom name here.
*/
@@ -1773,9 +1773,9 @@ event_callback (XEvent *event,
else
mode = ReplayPointer; /* give event back */
- meta_verbose ("Allowing events mode %s time %lu\n",
+ meta_verbose ("Allowing events mode %s time %u\n",
mode == AsyncPointer ? "AsyncPointer" : "ReplayPointer",
- (unsigned long) event->xbutton.time);
+ (unsigned int)event->xbutton.time);
XAllowEvents (display->xdisplay,
mode, event->xbutton.time);
@@ -2247,8 +2247,8 @@ event_callback (XEvent *event,
time = event->xclient.data.l[1];
meta_verbose ("Request to change current workspace to %d with "
- "specified timestamp of %lu\n",
- space, (unsigned long)time);
+ "specified timestamp of %u\n",
+ space, time);
workspace =
meta_screen_get_workspace_by_index (screen,
@@ -2955,7 +2955,7 @@ meta_spew_event (MetaDisplay *display,
aevent->alarm,
(gint64) sync_value_to_64 (&aevent->counter_value),
(gint64) sync_value_to_64 (&aevent->alarm_value),
- (unsigned int) aevent->time,
+ (unsigned int)aevent->time,
alarm_state_to_string (aevent->state));
}
else
@@ -3170,7 +3170,7 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
MetaGrabOp op,
gboolean change_pointer,
Window grab_xwindow,
- Time timestamp)
+ guint32 timestamp)
{
Cursor cursor;
@@ -3215,13 +3215,13 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
{
display->grab_have_pointer = TRUE;
meta_topic (META_DEBUG_WINDOW_OPS,
- "XGrabPointer() returned GrabSuccess time 0x%lu\n",
+ "XGrabPointer() returned GrabSuccess time %u\n",
timestamp);
}
else
{
meta_topic (META_DEBUG_WINDOW_OPS,
- "XGrabPointer() failed time 0x%lu\n",
+ "XGrabPointer() failed time %u\n",
timestamp);
}
meta_error_trap_pop (display, TRUE);
@@ -3242,7 +3242,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
int event_serial,
int button,
gulong modmask,
- Time timestamp,
+ guint32 timestamp,
int root_x,
int root_y)
{
@@ -3519,11 +3519,10 @@ meta_display_begin_grab_op (MetaDisplay *display,
void
meta_display_end_grab_op (MetaDisplay *display,
- Time timestamp)
+ guint32 timestamp)
{
meta_topic (META_DEBUG_WINDOW_OPS,
- "Ending grab op %u at time %lu\n", display->grab_op,
- (unsigned long) timestamp);
+ "Ending grab op %u at time %u\n", display->grab_op, timestamp);
if (display->grab_op == META_GRAB_OP_NONE)
return;
@@ -3610,15 +3609,14 @@ meta_display_end_grab_op (MetaDisplay *display,
if (display->grab_have_pointer)
{
meta_topic (META_DEBUG_WINDOW_OPS,
- "Ungrabbing pointer with timestamp %lu\n",
- timestamp);
+ "Ungrabbing pointer with timestamp %u\n", timestamp);
XUngrabPointer (display->xdisplay, timestamp);
}
if (display->grab_have_keyboard)
{
meta_topic (META_DEBUG_WINDOW_OPS,
- "Ungrabbing all keys timestamp %lu\n", timestamp);
+ "Ungrabbing all keys timestamp %u\n", timestamp);
if (display->grab_window)
meta_window_ungrab_all_keys (display->grab_window, timestamp);
else
@@ -4027,7 +4025,7 @@ meta_display_ping_timeout (gpointer data)
ping_data->ping_timeout_id = 0;
meta_topic (META_DEBUG_PING,
- "Ping %lu on window %lx timed out\n",
+ "Ping %u on window %lx timed out\n",
ping_data->timestamp, ping_data->xwindow);
(* ping_data->ping_timeout_func) (ping_data->display, ping_data->xwindow,
@@ -4044,7 +4042,7 @@ meta_display_ping_timeout (gpointer data)
void
meta_display_ping_window (MetaDisplay *display,
MetaWindow *window,
- Time timestamp,
+ guint32 timestamp,
MetaWindowPingFunc ping_reply_func,
MetaWindowPingFunc ping_timeout_func,
gpointer user_data)
@@ -4079,7 +4077,7 @@ meta_display_ping_window (MetaDisplay *display,
display->pending_pings = g_slist_prepend (display->pending_pings, ping_data);
meta_topic (META_DEBUG_PING,
- "Sending ping with timestamp %lu to window %s\n",
+ "Sending ping with timestamp %u to window %s\n",
timestamp, window->desc);
meta_window_send_icccm_message (window,
display->atom_net_wm_ping,
@@ -4160,18 +4158,19 @@ process_pong_message (MetaDisplay *display,
XEvent *event)
{
GSList *tmp;
+ guint32 timestamp = event->xclient.data.l[1];
- meta_topic (META_DEBUG_PING, "Received a pong with timestamp %lu\n",
- (Time) event->xclient.data.l[1]);
+ meta_topic (META_DEBUG_PING, "Received a pong with timestamp %u\n",
+ timestamp);
for (tmp = display->pending_pings; tmp; tmp = tmp->next)
{
MetaPingData *ping_data = tmp->data;
- if ((Time)event->xclient.data.l[1] == ping_data->timestamp)
+ if (timestamp == ping_data->timestamp)
{
meta_topic (META_DEBUG_PING,
- "Matching ping found for pong %lu\n",
+ "Matching ping found for pong %u\n",
ping_data->timestamp);
/* Remove the ping data from the list */
@@ -4870,15 +4869,15 @@ meta_display_focus_sentinel_clear (MetaDisplay *display)
static void
sanity_check_timestamps (MetaDisplay *display,
- Time timestamp)
+ guint32 timestamp)
{
if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_time))
{
- meta_warning ("last_focus_time (%lu) is greater than comparison "
- "timestamp (%lu). This most likely represents a buggy "
+ meta_warning ("last_focus_time (%u) is greater than comparison "
+ "timestamp (%u). This most likely represents a buggy "
"client sending inaccurate timestamps in messages such as "
"_NET_ACTIVE_WINDOW. Trying to work around...\n",
- display->last_focus_time, (unsigned long)timestamp);
+ display->last_focus_time, timestamp);
display->last_focus_time = timestamp;
}
if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_user_time))
@@ -4886,11 +4885,11 @@ sanity_check_timestamps (MetaDisplay *display,
GSList *windows;
GSList *tmp;
- meta_warning ("last_user_time (%lu) is greater than comparison "
- "timestamp (%lu). This most likely represents a buggy "
+ meta_warning ("last_user_time (%u) is greater than comparison "
+ "timestamp (%u). This most likely represents a buggy "
"client sending inaccurate timestamps in messages such as "
"_NET_ACTIVE_WINDOW. Trying to work around...\n",
- display->last_user_time, (unsigned long)timestamp);
+ display->last_user_time, timestamp);
display->last_user_time = timestamp;
windows = meta_display_list_windows (display);
@@ -4902,7 +4901,7 @@ sanity_check_timestamps (MetaDisplay *display,
if (XSERVER_TIME_IS_BEFORE (timestamp, window->net_wm_user_time))
{
meta_warning ("%s appears to be one of the offending windows "
- "with a timestamp of %lu. Working around...\n",
+ "with a timestamp of %u. Working around...\n",
window->desc, window->net_wm_user_time);
window->net_wm_user_time = timestamp;
}
@@ -4917,7 +4916,7 @@ sanity_check_timestamps (MetaDisplay *display,
static gboolean
timestamp_too_old (MetaDisplay *display,
MetaWindow *window,
- Time *timestamp)
+ guint32 *timestamp)
{
/* FIXME: If Soeren's suggestion in bug 151984 is implemented, it will allow
* us to sanity check the timestamp here and ensure it doesn't correspond to
@@ -4939,12 +4938,12 @@ timestamp_too_old (MetaDisplay *display,
if (XSERVER_TIME_IS_BEFORE (*timestamp, display->last_user_time))
{
meta_topic (META_DEBUG_FOCUS,
- "Ignoring focus request for %s since %lu "
- "is less than %lu and %lu.\n",
+ "Ignoring focus request for %s since %u "
+ "is less than %u and %u.\n",
window ? window->desc : "the no_focus_window",
*timestamp,
- (unsigned long) display->last_user_time,
- (unsigned long) display->last_focus_time);
+ display->last_user_time,
+ display->last_focus_time);
return TRUE;
}
else
@@ -4952,7 +4951,7 @@ timestamp_too_old (MetaDisplay *display,
meta_topic (META_DEBUG_FOCUS,
"Received focus request for %s which is newer than most "
"recent user_time, but less recent than "
- "last_focus_time (%lu < %lu < %lu); adjusting "
+ "last_focus_time (%u < %u < %u); adjusting "
"accordingly. (See bug 167358)\n",
window ? window->desc : "the no_focus_window",
display->last_user_time,
@@ -4970,7 +4969,7 @@ void
meta_display_set_input_focus_window (MetaDisplay *display,
MetaWindow *window,
gboolean focus_frame,
- Time timestamp)
+ guint32 timestamp)
{
if (timestamp_too_old (display, window, &timestamp))
return;
@@ -4990,7 +4989,7 @@ meta_display_set_input_focus_window (MetaDisplay *display,
void
meta_display_focus_the_no_focus_window (MetaDisplay *display,
MetaScreen *screen,
- Time timestamp)
+ guint32 timestamp)
{
if (timestamp_too_old (display, NULL, &timestamp))
return;
diff --git a/src/display.h b/src/display.h
index 66181caf..a844cc6d 100644
--- a/src/display.h
+++ b/src/display.h
@@ -62,7 +62,7 @@ typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
typedef void (* MetaWindowPingFunc) (MetaDisplay *display,
Window xwindow,
- Time timestamp,
+ guint32 timestamp,
gpointer user_data);
@@ -194,10 +194,10 @@ struct _MetaDisplay
MetaWindow *expected_focus_window;
/* last timestamp passed to XSetInputFocus */
- Time last_focus_time;
+ guint32 last_focus_time;
/* last user interaction time in any app */
- Time last_user_time;
+ guint32 last_user_time;
/* whether we're using mousenav (only relevant for sloppy&mouse focus modes;
* !mouse_mode means "keynav mode")
@@ -269,7 +269,7 @@ struct _MetaDisplay
gboolean grab_threshold_movement_reached; /* raise_on_click == FALSE. */
MetaResizePopup *grab_resize_popup;
GTimeVal grab_last_moveresize_time;
- Time grab_motion_notify_time;
+ guint32 grab_motion_notify_time;
int grab_wireframe_last_display_width;
int grab_wireframe_last_display_height;
GList* grab_old_window_stacking;
@@ -283,7 +283,7 @@ struct _MetaDisplay
#ifdef HAVE_XKB
int xkb_base_event_type;
- Time last_bell_time;
+ guint32 last_bell_time;
#endif
#ifdef HAVE_XSYNC
/* alarm monitoring client's _NET_WM_SYNC_REQUEST_COUNTER */
@@ -431,7 +431,7 @@ void meta_display_set_grab_op_cursor (MetaDisplay *display,
MetaGrabOp op,
gboolean change_pointer,
Window grab_xwindow,
- Time timestamp);
+ guint32 timestamp);
gboolean meta_display_begin_grab_op (MetaDisplay *display,
MetaScreen *screen,
@@ -441,11 +441,11 @@ gboolean meta_display_begin_grab_op (MetaDisplay *display,
int event_serial,
int button,
gulong modmask,
- Time timestamp,
+ guint32 timestamp,
int root_x,
int root_y);
void meta_display_end_grab_op (MetaDisplay *display,
- Time timestamp);
+ guint32 timestamp);
void meta_display_check_threshold_reached (MetaDisplay *display,
int x,
@@ -482,12 +482,12 @@ void meta_display_retheme_all (void);
void meta_display_set_cursor_theme (const char *theme,
int size);
-void meta_display_ping_window (MetaDisplay *display,
- MetaWindow *window,
- Time timestamp,
- MetaWindowPingFunc ping_reply_func,
- MetaWindowPingFunc ping_timeout_func,
- void *user_data);
+void meta_display_ping_window (MetaDisplay *display,
+ MetaWindow *window,
+ guint32 timestamp,
+ MetaWindowPingFunc ping_reply_func,
+ MetaWindowPingFunc ping_timeout_func,
+ void *user_data);
gboolean meta_display_window_has_pending_pings (MetaDisplay *display,
MetaWindow *window);
@@ -546,7 +546,7 @@ gboolean meta_display_focus_sentinel_clear (MetaDisplay *display);
void meta_display_set_input_focus_window (MetaDisplay *display,
MetaWindow *window,
gboolean focus_frame,
- Time timestamp);
+ guint32 timestamp);
/* meta_display_focus_the_no_focus_window is called when the
* designated no_focus_window should be focused, but is otherwise the
@@ -554,7 +554,7 @@ void meta_display_set_input_focus_window (MetaDisplay *display,
*/
void meta_display_focus_the_no_focus_window (MetaDisplay *display,
MetaScreen *screen,
- Time timestamp);
+ guint32 timestamp);
void meta_display_queue_autoraise_callback (MetaDisplay *display,
MetaWindow *window);
diff --git a/src/keybindings.c b/src/keybindings.c
index 6b9aa058..6433bb35 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -1209,7 +1209,7 @@ grab_status_to_string (int status)
static gboolean
grab_keyboard (MetaDisplay *display,
Window xwindow,
- Time timestamp)
+ guint32 timestamp)
{
int result;
int grab_status;
@@ -1228,9 +1228,9 @@ grab_keyboard (MetaDisplay *display,
{
meta_error_trap_pop_with_return (display, TRUE);
meta_topic (META_DEBUG_KEYBINDINGS,
- "XGrabKeyboard() returned failure status %s time %lu\n",
+ "XGrabKeyboard() returned failure status %s time %u\n",
grab_status_to_string (grab_status),
- (unsigned long) timestamp);
+ timestamp);
return FALSE;
}
else
@@ -1250,19 +1250,19 @@ grab_keyboard (MetaDisplay *display,
}
static void
-ungrab_keyboard (MetaDisplay *display, Time timestamp)
+ungrab_keyboard (MetaDisplay *display, guint32 timestamp)
{
meta_error_trap_push (display);
meta_topic (META_DEBUG_KEYBINDINGS,
- "Ungrabbing keyboard with timestamp %lu\n",
+ "Ungrabbing keyboard with timestamp %u\n",
timestamp);
XUngrabKeyboard (display->xdisplay, timestamp);
meta_error_trap_pop (display, FALSE);
}
gboolean
-meta_screen_grab_all_keys (MetaScreen *screen, Time timestamp)
+meta_screen_grab_all_keys (MetaScreen *screen, guint32 timestamp)
{
gboolean retval;
@@ -1284,7 +1284,7 @@ meta_screen_grab_all_keys (MetaScreen *screen, Time timestamp)
}
void
-meta_screen_ungrab_all_keys (MetaScreen *screen, Time timestamp)
+meta_screen_ungrab_all_keys (MetaScreen *screen, guint32 timestamp)
{
if (screen->all_keys_grabbed)
{
@@ -1300,7 +1300,7 @@ meta_screen_ungrab_all_keys (MetaScreen *screen, Time timestamp)
gboolean
meta_window_grab_all_keys (MetaWindow *window,
- Time timestamp)
+ guint32 timestamp)
{
Window grabwindow;
gboolean retval;
@@ -1335,7 +1335,7 @@ meta_window_grab_all_keys (MetaWindow *window,
}
void
-meta_window_ungrab_all_keys (MetaWindow *window, Time timestamp)
+meta_window_ungrab_all_keys (MetaWindow *window, guint32 timestamp)
{
if (window->all_keys_grabbed)
{
@@ -2627,7 +2627,7 @@ error_on_generic_command (const char *key,
const char *command,
const char *message,
int screen_number,
- Time timestamp)
+ guint32 timestamp)
{
GError *err;
char *argv[10];
@@ -2635,7 +2635,7 @@ error_on_generic_command (const char *key,
char timestampbuf[32];
sprintf (numbuf, "%d", screen_number);
- sprintf (timestampbuf, "%lu", timestamp);
+ sprintf (timestampbuf, "%u", timestamp);
argv[0] = METACITY_LIBEXECDIR"/metacity-dialog";
argv[1] = "--screen";
@@ -2671,7 +2671,7 @@ error_on_command (int command_index,
const char *command,
const char *message,
int screen_number,
- Time timestamp)
+ guint32 timestamp)
{
char *key;
@@ -2689,7 +2689,7 @@ static void
error_on_terminal_command (const char *command,
const char *message,
int screen_number,
- Time timestamp)
+ guint32 timestamp)
{
const char *key;
diff --git a/src/keybindings.h b/src/keybindings.h
index 5962f807..70848f92 100644
--- a/src/keybindings.h
+++ b/src/keybindings.h
@@ -29,16 +29,16 @@ void meta_display_init_keys (MetaDisplay *display);
void meta_display_shutdown_keys (MetaDisplay *display);
void meta_screen_grab_keys (MetaScreen *screen);
void meta_screen_ungrab_keys (MetaScreen *screen);
-gboolean meta_screen_grab_all_keys (MetaScreen *screen,
- Time timestamp);
-void meta_screen_ungrab_all_keys (MetaScreen *screen,
- Time timestamp);
+gboolean meta_screen_grab_all_keys (MetaScreen *screen,
+ guint32 timestamp);
+void meta_screen_ungrab_all_keys (MetaScreen *screen,
+ guint32 timestamp);
void meta_window_grab_keys (MetaWindow *window);
void meta_window_ungrab_keys (MetaWindow *window);
gboolean meta_window_grab_all_keys (MetaWindow *window,
- Time timestamp);
+ guint32 timestamp);
void meta_window_ungrab_all_keys (MetaWindow *window,
- Time timestamp);
+ guint32 timestamp);
void meta_display_process_key_event (MetaDisplay *display,
MetaWindow *window,
XEvent *event);
diff --git a/src/metacity-dialog.c b/src/metacity-dialog.c
index c94ca66c..28519be3 100644
--- a/src/metacity-dialog.c
+++ b/src/metacity-dialog.c
@@ -79,7 +79,7 @@ on_realize (GtkWidget *dialog,
static int
kill_window_question (const char *window_name,
const char *parent_str,
- Time timestamp)
+ guint32 timestamp)
{
GtkWidget *dialog;
char *str, *tmp;
@@ -227,8 +227,8 @@ create_lame_apps_list (char **lame_apps)
}
static int
-warn_about_no_sm_support (char **lame_apps,
- Time timestamp)
+warn_about_no_sm_support (char **lame_apps,
+ guint32 timestamp)
{
GtkWidget *dialog;
GtkWidget *list;
@@ -295,7 +295,7 @@ static int
error_about_command (const char *gconf_key,
const char *command,
const char *error,
- Time timestamp)
+ guint32 timestamp)
{
GtkWidget *dialog;
@@ -350,7 +350,7 @@ int
main (int argc, char **argv)
{
GOptionContext *ctx;
- Time timestamp = 0;
+ guint32 timestamp = 0;
gint num_args = 0;
bindtextdomain (GETTEXT_PACKAGE, METACITY_LOCALEDIR);
diff --git a/src/screen.c b/src/screen.c
index 4a8a5e5b..77b90789 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -367,7 +367,7 @@ reload_xinerama_infos (MetaScreen *screen)
MetaScreen*
meta_screen_new (MetaDisplay *display,
int number,
- Time timestamp)
+ guint32 timestamp)
{
MetaScreen *screen;
Window xroot;
@@ -378,7 +378,7 @@ meta_screen_new (MetaDisplay *display,
gboolean replace_current_wm;
Atom wm_sn_atom;
char buf[128];
- Time manager_timestamp;
+ guint32 manager_timestamp;
gulong current_workspace;
replace_current_wm = meta_get_replace_current_wm ();
@@ -2287,7 +2287,7 @@ meta_screen_minimize_all_on_active_workspace_except (MetaScreen *screen,
void
meta_screen_show_desktop (MetaScreen *screen,
- Time timestamp)
+ guint32 timestamp)
{
GList *windows;
@@ -2604,7 +2604,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
if (sequence != NULL)
{
int space;
- Time timestamp;
+ guint32 timestamp;
meta_topic (META_DEBUG_STARTUP,
"Found startup sequence for window %s ID \"%s\"\n",
@@ -2628,7 +2628,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
{
timestamp = sn_startup_sequence_get_timestamp (sequence);
meta_topic (META_DEBUG_STARTUP,
- "Setting initial window timestamp to %lu based on startup info\n",
+ "Setting initial window timestamp to %u based on startup info\n",
timestamp);
window->initial_timestamp_set = TRUE;
diff --git a/src/screen.h b/src/screen.h
index 8349b0fb..735f5333 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -87,7 +87,7 @@ struct _MetaScreen
Window wm_sn_selection_window;
Atom wm_sn_atom;
- Time wm_sn_timestamp;
+ guint32 wm_sn_timestamp;
MetaXineramaScreenInfo *xinerama_infos;
int n_xinerama_infos;
@@ -122,7 +122,7 @@ struct _MetaScreen
MetaScreen* meta_screen_new (MetaDisplay *display,
int number,
- Time timestamp);
+ guint32 timestamp);
void meta_screen_free (MetaScreen *screen);
void meta_screen_manage_all_windows (MetaScreen *screen);
MetaScreen* meta_screen_for_x_screen (Screen *xscreen);
@@ -197,7 +197,7 @@ void meta_screen_minimize_all_on_active_workspace_except (MetaScreen *screen
/* Show/hide the desktop (temporarily hide all windows) */
void meta_screen_show_desktop (MetaScreen *screen,
- Time timestamp);
+ guint32 timestamp);
void meta_screen_unshow_desktop (MetaScreen *screen);
/* Update whether the destkop is being shown for the current active_workspace */
diff --git a/src/session.c b/src/session.c
index 0f87b988..cc625e29 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1790,7 +1790,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
GError *err;
GIOChannel *channel;
LameClientsDialogData *d;
- Time timestamp;
+ guint32 timestamp;
char timestampbuf[32];
lame = NULL;
@@ -1855,7 +1855,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
timestamp = property_event.xproperty.time;
}
- sprintf (timestampbuf, "%lu", timestamp);
+ sprintf (timestampbuf, "%u", timestamp);
len = g_slist_length (lame);
len *= 2; /* titles and also classes */
diff --git a/src/window.c b/src/window.c
index 6dd16784..044f1aa5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1634,7 +1634,7 @@ meta_window_queue_calc_showing (MetaWindow *window)
static gboolean
intervening_user_event_occurred (MetaWindow *window)
{
- Time compare;
+ guint32 compare;
MetaWindow *focus_window;
focus_window = window->display->focus_window;
@@ -1642,9 +1642,9 @@ intervening_user_event_occurred (MetaWindow *window)
meta_topic (META_DEBUG_STARTUP,
"COMPARISON:\n"
" net_wm_user_time_set : %d\n"
- " net_wm_user_time : %lu\n"
+ " net_wm_user_time : %u\n"
" initial_timestamp_set: %d\n"
- " initial_timestamp : %lu\n",
+ " initial_timestamp : %u\n",
window->net_wm_user_time_set,
window->net_wm_user_time,
window->initial_timestamp_set,
@@ -1655,7 +1655,7 @@ intervening_user_event_occurred (MetaWindow *window)
"COMPARISON (continued):\n"
" focus_window : %s\n"
" fw->net_wm_user_time_set : %d\n"
- " fw->net_wm_user_time : %lu\n",
+ " fw->net_wm_user_time : %u\n",
focus_window->desc,
focus_window->net_wm_user_time_set,
focus_window->net_wm_user_time);
@@ -1710,8 +1710,9 @@ intervening_user_event_occurred (MetaWindow *window)
XSERVER_TIME_IS_BEFORE (compare, focus_window->net_wm_user_time))
{
meta_topic (META_DEBUG_STARTUP,
- "window %s focus prevented by other activity; %lu < %lu\n",
- window->desc, compare,
+ "window %s focus prevented by other activity; %u < %u\n",
+ window->desc,
+ compare,
focus_window->net_wm_user_time);
return TRUE;
}
@@ -2521,9 +2522,9 @@ window_activate (MetaWindow *window,
{
gboolean can_ignore_outdated_timestamps;
meta_topic (META_DEBUG_FOCUS,
- "_NET_ACTIVE_WINDOW message sent for %s at time %lu "
+ "_NET_ACTIVE_WINDOW message sent for %s at time %u "
"by client type %u.\n",
- window->desc, (unsigned long)timestamp, source_indication);
+ window->desc, timestamp, source_indication);
/* Older EWMH spec didn't specify a timestamp; we decide to honor these only
* if the app specifies that it is a pager.
@@ -2538,7 +2539,7 @@ window_activate (MetaWindow *window,
can_ignore_outdated_timestamps)
{
meta_topic (META_DEBUG_FOCUS,
- "last_user_time (%lu) is more recent; ignoring "
+ "last_user_time (%u) is more recent; ignoring "
" _NET_ACTIVE_WINDOW message.\n",
window->display->last_user_time);
meta_window_set_demands_attention(window);
@@ -3737,7 +3738,7 @@ get_modal_transient (MetaWindow *window)
/* XXX META_EFFECT_FOCUS */
void
meta_window_focus (MetaWindow *window,
- Time timestamp)
+ guint32 timestamp)
{
MetaWindow *modal_transient;
@@ -4122,7 +4123,7 @@ meta_window_lower (MetaWindow *window)
void
meta_window_send_icccm_message (MetaWindow *window,
Atom atom,
- Time timestamp)
+ guint32 timestamp)
{
/* This comment and code are from twm, copyright
* Open Group, Evans & Sutherland, etc.
@@ -4351,8 +4352,8 @@ meta_window_configure_request (MetaWindow *window,
{
meta_topic (META_DEBUG_STACK,
"Ignoring xconfigure stacking request from %s (with "
- "user_time %lu); currently active application is %s (with "
- "user_time %lu).\n",
+ "user_time %u); currently active application is %s (with "
+ "user_time %u).\n",
window->desc,
window->net_wm_user_time,
active_window->desc,
@@ -4411,7 +4412,7 @@ meta_window_client_message (MetaWindow *window,
if (event->xclient.message_type ==
display->atom_net_close_window)
{
- Time timestamp;
+ guint32 timestamp;
if (event->xclient.data.l[0] != 0)
timestamp = event->xclient.data.l[0];
@@ -6044,7 +6045,7 @@ static void
menu_callback (MetaWindowMenu *menu,
Display *xdisplay,
Window client_xwindow,
- Time timestamp,
+ guint32 timestamp,
MetaMenuOp op,
int workspace_index,
gpointer data)
@@ -6187,7 +6188,7 @@ meta_window_show_menu (MetaWindow *window,
int root_x,
int root_y,
int button,
- Time timestamp)
+ guint32 timestamp)
{
MetaMenuOp ops;
MetaMenuOp insensitive;
@@ -6919,8 +6920,8 @@ update_resize (MetaWindow *window,
typedef struct
{
const XEvent *current_event;
- int count;
- Time last_time;
+ int count;
+ guint32 last_time;
} EventScannerData;
static Bool
@@ -6956,9 +6957,9 @@ check_use_this_motion_notify (MetaWindow *window,
event->xmotion.time)
{
meta_topic (META_DEBUG_RESIZING,
- "Arrived at event with time %lu (waiting for %lu), using it\n",
- (unsigned long) event->xmotion.time,
- (unsigned long) window->display->grab_motion_notify_time);
+ "Arrived at event with time %u (waiting for %u), using it\n",
+ (unsigned int)event->xmotion.time,
+ window->display->grab_motion_notify_time);
window->display->grab_motion_notify_time = 0;
return TRUE;
}
@@ -6978,8 +6979,8 @@ check_use_this_motion_notify (MetaWindow *window,
if (esd.count > 0)
meta_topic (META_DEBUG_RESIZING,
- "Will skip %d motion events and use the event with time %lu\n",
- esd.count, (unsigned long) esd.last_time);
+ "Will skip %d motion events and use the event with time %u\n",
+ esd.count, (unsigned int) esd.last_time);
if (esd.last_time == 0)
return TRUE;
@@ -7548,7 +7549,7 @@ warp_grab_pointer (MetaWindow *window,
void
meta_window_begin_grab_op (MetaWindow *window,
MetaGrabOp op,
- Time timestamp)
+ guint32 timestamp)
{
int x, y;
gulong grab_start_serial;
@@ -7689,7 +7690,7 @@ meta_window_stack_just_below (MetaWindow *window,
void
meta_window_set_user_time (MetaWindow *window,
- Time timestamp)
+ guint32 timestamp)
{
/* FIXME: If Soeren's suggestion in bug 151984 is implemented, it will allow
* us to sanity check the timestamp here and ensure it doesn't correspond to
@@ -7701,15 +7702,14 @@ meta_window_set_user_time (MetaWindow *window,
XSERVER_TIME_IS_BEFORE (timestamp, window->net_wm_user_time))
{
meta_topic (META_DEBUG_STARTUP,
- "Window %s _NET_WM_USER_TIME not updated to %lu, because it "
- "is less than %lu\n",
+ "Window %s _NET_WM_USER_TIME not updated to %u, because it "
+ "is less than %u\n",
window->desc, timestamp, window->net_wm_user_time);
-
}
else
{
meta_topic (META_DEBUG_STARTUP,
- "Window %s has _NET_WM_USER_TIME of %lu\n",
+ "Window %s has _NET_WM_USER_TIME of %u\n",
window->desc, timestamp);
window->net_wm_user_time_set = TRUE;
window->net_wm_user_time = timestamp;
diff --git a/src/window.h b/src/window.h
index 8da1af8c..1ea19761 100644
--- a/src/window.h
+++ b/src/window.h
@@ -118,7 +118,7 @@ struct _MetaWindow
int initial_workspace;
/* Initial timestamp property */
- Time initial_timestamp;
+ guint32 initial_timestamp;
/* Whether we're maximized */
guint maximized_horizontally : 1;
@@ -312,7 +312,7 @@ struct _MetaWindow
/* set to the most recent user-interaction event timestamp that we
know about for this window */
- Time net_wm_user_time;
+ guint32 net_wm_user_time;
/* The size we set the window to last (i.e. what we believe
* to be its actual size on the server). The x, y are
@@ -486,10 +486,10 @@ void meta_window_update_wireframe (MetaWindow *window,
void meta_window_end_wireframe (MetaWindow *window);
void meta_window_delete (MetaWindow *window,
- Time timestamp);
+ guint32 timestamp);
void meta_window_kill (MetaWindow *window);
void meta_window_focus (MetaWindow *window,
- Time timestamp);
+ guint32 timestamp);
void meta_window_raise (MetaWindow *window);
void meta_window_lower (MetaWindow *window);
@@ -498,7 +498,7 @@ void meta_window_update_unfocused_button_grabs (MetaWindow *window);
/* Sends a client message */
void meta_window_send_icccm_message (MetaWindow *window,
Atom atom,
- Time timestamp);
+ guint32 timestamp);
gboolean meta_window_configure_request (MetaWindow *window,
@@ -518,7 +518,7 @@ void meta_window_show_menu (MetaWindow *window,
int root_x,
int root_y,
int button,
- Time timestamp);
+ guint32 timestamp);
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
@@ -572,7 +572,7 @@ MetaWindow* meta_window_find_root_ancestor (MetaWindow *window);
void meta_window_begin_grab_op (MetaWindow *window,
MetaGrabOp op,
- Time timestamp);
+ guint32 timestamp);
void meta_window_update_keyboard_resize (MetaWindow *window,
gboolean update_cursor);
@@ -594,7 +594,7 @@ void meta_window_stack_just_below (MetaWindow *window,
MetaWindow *below_this_one);
void meta_window_set_user_time (MetaWindow *window,
- Time timestamp);
+ guint32 timestamp);
void meta_window_set_demands_attention (MetaWindow *window);
diff --git a/src/workspace.c b/src/workspace.c
index 217df4e6..89af6adc 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -32,7 +32,7 @@ void meta_workspace_queue_calc_showing (MetaWorkspace *workspace);
static void set_active_space_hint (MetaScreen *screen);
static void focus_ancestor_or_mru_window (MetaWorkspace *workspace,
MetaWindow *not_this_one,
- Time timestamp);
+ guint32 timestamp);
static void
maybe_add_to_list (MetaScreen *screen, MetaWindow *window, gpointer data)
@@ -274,7 +274,7 @@ meta_workspace_queue_calc_showing (MetaWorkspace *workspace)
void
meta_workspace_activate_with_focus (MetaWorkspace *workspace,
MetaWindow *focus_this,
- Time timestamp)
+ guint32 timestamp)
{
MetaWorkspace *old;
MetaWindow *move_window;
@@ -350,7 +350,7 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
void
meta_workspace_activate (MetaWorkspace *workspace,
- Time timestamp)
+ guint32 timestamp)
{
meta_workspace_activate_with_focus (workspace, NULL, timestamp);
}
@@ -872,7 +872,7 @@ meta_workspace_get_name (MetaWorkspace *workspace)
void
meta_workspace_focus_default_window (MetaWorkspace *workspace,
MetaWindow *not_this_one,
- Time timestamp)
+ guint32 timestamp)
{
if (timestamp == CurrentTime)
{
@@ -949,7 +949,7 @@ record_ancestor (MetaWindow *window,
static void
focus_ancestor_or_mru_window (MetaWorkspace *workspace,
MetaWindow *not_this_one,
- Time timestamp)
+ guint32 timestamp)
{
MetaWindow *window = NULL;
MetaWindow *desktop_window = NULL;
diff --git a/src/workspace.h b/src/workspace.h
index 73f71010..1c1ee919 100644
--- a/src/workspace.h
+++ b/src/workspace.h
@@ -67,9 +67,9 @@ void meta_workspace_relocate_windows (MetaWorkspace *workspace,
MetaWorkspace *new_home);
void meta_workspace_activate_with_focus (MetaWorkspace *workspace,
MetaWindow *focus_this,
- Time timestamp);
+ guint32 timestamp);
void meta_workspace_activate (MetaWorkspace *workspace,
- Time timestamp);
+ guint32 timestamp);
int meta_workspace_index (MetaWorkspace *workspace);
GList* meta_workspace_list_windows (MetaWorkspace *workspace);
@@ -89,7 +89,7 @@ void meta_workspace_get_work_area_all_xineramas (MetaWorkspace *workspace,
void meta_workspace_focus_default_window (MetaWorkspace *workspace,
MetaWindow *not_this_one,
- Time timestamp);
+ guint32 timestamp);
MetaWorkspace* meta_workspace_get_neighbor (MetaWorkspace *workspace,
MetaMotionDirection direction);