aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-05-26 18:00:58 +0800
committerXavier Claessens <xclaesse@gmail.com>2011-05-26 18:49:48 +0800
commit984e946f6bb2c385394db123f1b2edea05d9209b (patch)
tree8e28463d0f004583b2b4a5346cfd44a3b547c8ab
parentff175f03615bdbd8d05bf352b3e4b49d59b3ce25 (diff)
downloadgsoc2013-empathy-984e946f6bb2c385394db123f1b2edea05d9209b.tar
gsoc2013-empathy-984e946f6bb2c385394db123f1b2edea05d9209b.tar.gz
gsoc2013-empathy-984e946f6bb2c385394db123f1b2edea05d9209b.tar.bz2
gsoc2013-empathy-984e946f6bb2c385394db123f1b2edea05d9209b.tar.lz
gsoc2013-empathy-984e946f6bb2c385394db123f1b2edea05d9209b.tar.xz
gsoc2013-empathy-984e946f6bb2c385394db123f1b2edea05d9209b.tar.zst
gsoc2013-empathy-984e946f6bb2c385394db123f1b2edea05d9209b.zip
Stop dealing with iconification of main window, just hide/present it
It does not work with gnome-shell, unity and indicators anyway, so it is just complex code for no benefit anymore.
-rw-r--r--libempathy-gtk/empathy-ui-utils.c53
-rw-r--r--libempathy-gtk/empathy-ui-utils.h3
-rw-r--r--src/empathy-status-icon.c8
3 files changed, 4 insertions, 60 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index cc829a894..a1bd50f1a 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1532,56 +1532,6 @@ empathy_text_iter_backward_search (const GtkTextIter *iter,
return retval;
}
-gboolean
-empathy_window_get_is_visible (GtkWindow *window)
-{
- GdkWindowState state;
- GdkWindow *gdk_window;
-
- g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
-
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- if (!gdk_window) {
- return FALSE;
- }
-
- state = gdk_window_get_state (gdk_window);
- if (state & (GDK_WINDOW_STATE_WITHDRAWN | GDK_WINDOW_STATE_ICONIFIED)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-void
-empathy_window_iconify (GtkWindow *window, GtkStatusIcon *status_icon)
-{
- GdkRectangle icon_location;
- gulong data[4];
- Display *dpy;
- GdkWindow *gdk_window;
-
- gtk_status_icon_get_geometry (status_icon, NULL, &icon_location, NULL);
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- dpy = GDK_WINDOW_XDISPLAY (gdk_window);
-
- data[0] = icon_location.x;
- data[1] = icon_location.y;
- data[2] = icon_location.width;
- data[3] = icon_location.height;
-
- XChangeProperty (dpy,
- GDK_WINDOW_XID (gdk_window),
- gdk_x11_get_xatom_by_name_for_display (
- gdk_window_get_display (gdk_window),
- "_NET_WM_ICON_GEOMETRY"),
- XA_CARDINAL, 32, PropModeReplace,
- (guchar *)&data, 4);
-
- gtk_window_set_skip_taskbar_hint (window, TRUE);
- gtk_window_iconify (window);
-}
-
/* Takes care of moving the window to the current workspace. */
void
empathy_window_present_with_time (GtkWindow *window,
@@ -1613,9 +1563,6 @@ empathy_window_present_with_time (GtkWindow *window,
gtk_window_present (window);
else
gtk_window_present_with_time (window, timestamp);
-
- gtk_window_set_skip_taskbar_hint (window, FALSE);
- gtk_window_deiconify (window);
}
void
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index d33b8c987..af484012c 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -121,12 +121,9 @@ gboolean empathy_text_iter_backward_search (const GtkTextIter*iter,
GtkTextIter *match_end,
const GtkTextIter*limit);
/* Windows */
-gboolean empathy_window_get_is_visible (GtkWindow *window);
void empathy_window_present (GtkWindow *window);
void empathy_window_present_with_time (GtkWindow *window,
guint32 timestamp);
-void empathy_window_iconify (GtkWindow *window,
- GtkStatusIcon *status_icon);
GtkWindow * empathy_get_toplevel_window (GtkWidget *widget);
/* URL */
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 38a68d433..008ea4701 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -62,7 +62,7 @@ typedef struct {
EmpathyEvent *event;
GSettings *gsettings_ui;
- GtkWindow *window;
+ GtkWidget *window;
GtkUIManager *ui_manager;
GtkWidget *popup_menu;
GtkAction *show_window_item;
@@ -222,7 +222,7 @@ status_icon_set_visibility (EmpathyStatusIcon *icon,
}
if (!visible) {
- empathy_window_iconify (priv->window, priv->icon);
+ gtk_widget_hide (priv->window);
} else {
empathy_window_present (GTK_WINDOW (priv->window));
}
@@ -246,7 +246,7 @@ status_icon_toggle_visibility (EmpathyStatusIcon *icon)
EmpathyStatusIconPriv *priv = GET_PRIV (icon);
gboolean visible;
- visible = gtk_window_is_active (priv->window);
+ visible = gtk_window_is_active (GTK_WINDOW (priv->window));
status_icon_set_visibility (icon, !visible, TRUE);
}
@@ -334,7 +334,7 @@ status_icon_popup_menu_cb (GtkStatusIcon *status_icon,
GtkWidget *submenu;
gboolean show;
- show = empathy_window_get_is_visible (GTK_WINDOW (priv->window));
+ show = gtk_widget_get_visible (priv->window);
g_signal_handlers_block_by_func (priv->show_window_item,
status_icon_show_hide_window_cb,