aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget-jabber.ui2
-rw-r--r--libempathy-gtk/empathy-notify-manager.h4
-rw-r--r--libempathy-gtk/empathy-ui-utils.c53
3 files changed, 52 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-account-widget-jabber.ui b/libempathy-gtk/empathy-account-widget-jabber.ui
index 7e99b3793..746e038a2 100644
--- a/libempathy-gtk/empathy-account-widget-jabber.ui
+++ b/libempathy-gtk/empathy-account-widget-jabber.ui
@@ -140,7 +140,7 @@
<object class="GtkLabel" id="label_username_f_example">
<property name="xalign">0</property>
<property name="xpad">3</property>
- <property name="label" translatable="yes">This is your username, not your normal Facebook login.
+ <property name="label" translatable="yes" comments="This string is not wrapped in the dialog so you may have to add some '\n' to make it look nice.">This is your username, not your normal Facebook login.
If you are facebook.com/&lt;b&gt;badger&lt;/b&gt;, enter &lt;b&gt;badger&lt;/b&gt;.
Use &lt;a href="http://www.facebook.com/username/"&gt;this page&lt;/a&gt; to choose a Facebook username if you don't have one.</property>
<property name="use_markup">True</property>
diff --git a/libempathy-gtk/empathy-notify-manager.h b/libempathy-gtk/empathy-notify-manager.h
index 70acd7887..ff62a872a 100644
--- a/libempathy-gtk/empathy-notify-manager.h
+++ b/libempathy-gtk/empathy-notify-manager.h
@@ -26,7 +26,6 @@
G_BEGIN_DECLS
#define EMPATHY_NOTIFY_MANAGER_CAP_ACTIONS "actions"
-#define EMPATHY_NOTIFY_MANAGER_CAP_APPEND "append"
#define EMPATHY_NOTIFY_MANAGER_CAP_BODY "body"
#define EMPATHY_NOTIFY_MANAGER_CAP_BODY_HYPERLINKS "body-hyperlinks"
#define EMPATHY_NOTIFY_MANAGER_CAP_BODY_IMAGES "body-images"
@@ -34,10 +33,7 @@ G_BEGIN_DECLS
#define EMPATHY_NOTIFY_MANAGER_CAP_ICON_MULTI "icon-multi"
#define EMPATHY_NOTIFY_MANAGER_CAP_ICON_STATIC "icon-static"
#define EMPATHY_NOTIFY_MANAGER_CAP_IMAGE_SVG_XML "image/svg+xml"
-#define EMPATHY_NOTIFY_MANAGER_CAP_PRIVATE_ICON_ONLY "private-icon-only"
-#define EMPATHY_NOTIFY_MANAGER_CAP_PRIVATE_SYNCHRONOUS "private-synchronous"
#define EMPATHY_NOTIFY_MANAGER_CAP_SOUND "sound"
-#define EMPATHY_NOTIFY_MANAGER_CAP_TRUNCATION "truncation"
/* notify-osd specific */
#define EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND "x-canonical-append"
#define EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_PRIVATE_ICON_ONLY "x-canonical-private-icon-only"
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 4503a39cc..ef7ff78b2 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1383,6 +1383,55 @@ empathy_window_iconify (GtkWindow *window, GtkStatusIcon *status_icon)
gtk_window_iconify (window);
}
+/* Code from Thomas Thurman
+ * http://people.collabora.co.uk/~tthurman/pingwindow.c.txt
+ */
+static guint32
+get_server_time (void)
+{
+ Display *display;
+ Window pingingWindow;
+ XEvent propertyEvent;
+ XSetWindowAttributes attrs;
+
+ display = XOpenDisplay (NULL);
+
+ attrs.override_redirect = True;
+ attrs.event_mask = PropertyChangeMask;
+
+ pingingWindow = XCreateWindow (display,
+ XRootWindow (display, 0), /* parent */
+ -100, -100, 1, 1, /* off-screen */
+ 0,
+ CopyFromParent,
+ CopyFromParent,
+ (Visual *)CopyFromParent,
+ CWOverrideRedirect | CWEventMask,
+ &attrs);
+
+ /* Change a property. XA_PRIMARY is never really
+ * used for properties, so it's safe.
+ */
+ XChangeProperty (display,
+ pingingWindow,
+ XA_PRIMARY, XA_STRING, 8,
+ PropModeAppend, NULL, 0);
+
+ /* Pick up the event. */
+ XWindowEvent (display,
+ pingingWindow,
+ PropertyChangeMask,
+ &propertyEvent);
+
+ /* If you want to do this often,
+ * just keep the window around and
+ * don't destroy it.
+ */
+ XDestroyWindow (display, pingingWindow);
+
+ return ((XPropertyEvent*)&propertyEvent)->time;
+}
+
/* Takes care of moving the window to the current workspace. */
void
empathy_window_present (GtkWindow *window)
@@ -1412,8 +1461,8 @@ empathy_window_present (GtkWindow *window)
timestamp = gtk_get_current_event_time ();
if (timestamp == 0)
- /* No event, fallback to _NET_WM_USER_TIME */
- timestamp = gdk_x11_display_get_user_time (gdk_display_get_default ());
+ /* No event, fallback to X server time */
+ timestamp = get_server_time ();
gtk_window_present_with_time (window, timestamp);
gtk_window_set_skip_taskbar_hint (window, FALSE);