From 22f03e75fd3a285e7242d6f74ba8921039c2e632 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 31 Aug 2008 15:24:37 +0000 Subject: [PATCH] Fix window manager warnings shown in ~/.xsession-errors 2008-08-31 Carlos Garcia Campos * shell/ev-application.[ch]: (ev_application_open_window), (ev_application_add_icon_path_for_screen), (ev_application_open_uri_at_dest): Fix window manager warnings shown in ~/.xsession-errors svn path=/trunk/; revision=3131 --- ChangeLog | 8 ++++++++ shell/ev-application.c | 20 ++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55c9b2d5..829f6c29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-31 Carlos Garcia Campos + + * shell/ev-application.[ch]: (ev_application_open_window), + (ev_application_add_icon_path_for_screen), + (ev_application_open_uri_at_dest): + + Fix window manager warnings shown in ~/.xsession-errors + 2008-08-31 Carlos Garcia Campos * configure.ac: diff --git a/shell/ev-application.c b/shell/ev-application.c index eda6d0c4..8fb48711 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "totem-scrsaver.h" #include "eggsmclient.h" @@ -449,11 +450,15 @@ ev_application_open_window (EvApplication *application, gtk_window_set_screen (GTK_WINDOW (new_window), screen); } ev_application_add_icon_path_for_screen (screen); - + gtk_widget_show (new_window); - gtk_window_present_with_time (GTK_WINDOW (new_window), - timestamp); + if (timestamp <= 0) + timestamp = gdk_x11_get_server_time (GTK_WIDGET (new_window)->window); + gdk_x11_window_set_user_time (GTK_WIDGET (new_window)->window, timestamp); + + gtk_window_present (GTK_WINDOW (new_window)); + return TRUE; } @@ -533,7 +538,7 @@ ev_application_add_icon_path_for_screen (GdkScreen *screen) { GtkIconTheme *icon_theme; - icon_theme = gtk_icon_theme_get_for_screen (screen); + icon_theme = screen ? gtk_icon_theme_get_for_screen (screen) : gtk_icon_theme_get_default (); if (icon_theme) { gchar **path = NULL; gint n_paths; @@ -608,8 +613,11 @@ ev_application_open_uri_at_dest (EvApplication *application, gtk_widget_show (GTK_WIDGET (new_window)); ev_document_fc_mutex_unlock (); - gtk_window_present_with_time (GTK_WINDOW (new_window), - timestamp); + if (timestamp <= 0) + timestamp = gdk_x11_get_server_time (GTK_WIDGET (new_window)->window); + gdk_x11_window_set_user_time (GTK_WIDGET (new_window)->window, timestamp); + + gtk_window_present (GTK_WINDOW (new_window)); } /** -- 2.43.0