[tomboy] Remove unmanaged window present code and replaced it with managed code. Eliminates two methods from
- From: Aaron Borden <adborden src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tomboy] Remove unmanaged window present code and replaced it with managed code. Eliminates two methods from
- Date: Sat, 11 Jun 2011 21:25:03 +0000 (UTC)
commit 8358cbe68da623d6416bd1e5b78d35e18317e508
Author: Michael Fletcher <m fletcher theplanet ca>
Date: Mon May 18 10:29:36 2009 -0600
Remove unmanaged window present code and replaced it with managed code. Eliminates two methods from libtomboy.
Adapted from patch written by alp atoker com
Tomboy/Utils.cs | 6 ++----
libtomboy/tomboyutil.c | 44 --------------------------------------------
libtomboy/tomboyutil.h | 2 --
3 files changed, 2 insertions(+), 50 deletions(-)
---
diff --git a/Tomboy/Utils.cs b/Tomboy/Utils.cs
index 1ccae6a..262b657 100644
--- a/Tomboy/Utils.cs
+++ b/Tomboy/Utils.cs
@@ -900,12 +900,10 @@ namespace Tomboy
{
}
#if !WIN32 && !MAC
- [DllImport("libtomboy")]
- static extern void tomboy_window_present_hardcore (IntPtr win);
-
public new void Present ()
{
- tomboy_window_present_hardcore (this.Handle);
+ //delay Present() to play well with global key bindings
+ Gtk.Application.Invoke (delegate { base.Present (); } );
}
#endif
}
diff --git a/libtomboy/tomboyutil.c b/libtomboy/tomboyutil.c
index 2987aa6..69e271e 100644
--- a/libtomboy/tomboyutil.c
+++ b/libtomboy/tomboyutil.c
@@ -119,47 +119,3 @@ tomboy_window_move_to_current_workspace (GtkWindow *window)
SubstructureRedirectMask | SubstructureNotifyMask,
&xev);
}
-
-static void
-tomboy_window_override_user_time (GtkWindow *window)
-{
- guint32 ev_time = gtk_get_current_event_time();
-
- if (ev_time == 0) {
- /*
- * FIXME: Global keypresses use an event filter on the root
- * window, which processes events before GDK sees them.
- */
- ev_time = tomboy_keybinder_get_current_event_time ();
- }
- if (ev_time == 0) {
- gint ev_mask = gtk_widget_get_events (GTK_WIDGET(window));
- if (!(ev_mask & GDK_PROPERTY_CHANGE_MASK)) {
- gtk_widget_add_events (GTK_WIDGET (window),
- GDK_PROPERTY_CHANGE_MASK);
- }
-
- /*
- * NOTE: Last resort for D-BUS or other non-interactive
- * openings. Causes roundtrip to server. Lame.
- */
- ev_time = gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (window)));
- }
-
- TRACE (g_print("Setting _NET_WM_USER_TIME to: %d\n", ev_time));
- gdk_x11_window_set_user_time (gtk_widget_get_window (GTK_WIDGET (window)), ev_time);
-}
-
-void
-tomboy_window_present_hardcore (GtkWindow *window)
-{
- if (!GTK_WIDGET_REALIZED (window))
- gtk_widget_realize (GTK_WIDGET (window));
- else if (GTK_WIDGET_VISIBLE (window))
- tomboy_window_move_to_current_workspace (window);
-
- tomboy_window_override_user_time (window);
-
- gtk_window_present (window);
-}
-
diff --git a/libtomboy/tomboyutil.h b/libtomboy/tomboyutil.h
index c691331..fd8bfad 100644
--- a/libtomboy/tomboyutil.h
+++ b/libtomboy/tomboyutil.h
@@ -37,8 +37,6 @@ gint tomboy_window_get_workspace (GtkWindow *window);
void tomboy_window_move_to_current_workspace (GtkWindow *window);
-void tomboy_window_present_hardcore (GtkWindow *window);
-
G_END_DECLS
#endif /* __TOMBOY_UTIL_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]