diff options
-rw-r--r-- | comphelper/source/misc/uieventslogger.cxx | 30 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 51 | ||||
-rw-r--r-- | vcl/unx/inc/plugins/gtk/gtkframe.hxx | 2 |
3 files changed, 58 insertions, 25 deletions
diff --git a/comphelper/source/misc/uieventslogger.cxx b/comphelper/source/misc/uieventslogger.cxx index ae351340bc7a..b88abff17f4a 100644 --- a/comphelper/source/misc/uieventslogger.cxx +++ b/comphelper/source/misc/uieventslogger.cxx @@ -383,6 +383,16 @@ namespace comphelper logdata[3] = URL_FILE; else logdata[3] = url.Main; + OSL_TRACE("UiEventsLogger Logging: %s,%s,%s,%s,%s,%s,%s,%s", + OUStringToOString(logdata[0],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[1],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[2],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[3],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[4],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[5],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[6],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[7],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[8],RTL_TEXTENCODING_UTF8).getStr()); m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata)); m_SessionLogEventCount++; } @@ -391,6 +401,16 @@ namespace comphelper { Sequence<OUString> logdata = Sequence<OUString>(COLUMNS); logdata[0] = ETYPE_ROTATED; + OSL_TRACE("UiEventsLogger Logging: %s,%s,%s,%s,%s,%s,%s,%s", + OUStringToOString(logdata[0],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[1],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[2],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[3],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[4],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[5],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[6],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[7],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[8],RTL_TEXTENCODING_UTF8).getStr()); m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata)); } @@ -412,6 +432,16 @@ namespace comphelper logdata[6] = id; logdata[7] = method; logdata[8] = param; + OSL_TRACE("UiEventsLogger Logging: %s,%s,%s,%s,%s,%s,%s,%s", + OUStringToOString(logdata[0],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[1],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[2],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[3],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[4],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[5],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[6],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[7],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[8],RTL_TEXTENCODING_UTF8).getStr()); m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata)); m_SessionLogEventCount++; } diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 8963ac2e3643..eff7319d6efc 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -70,9 +70,9 @@ #ifdef ENABLE_DBUS #include <dbus/dbus-glib.h> -#define GSS_DBUS_SERVICE "org.gnome.ScreenSaver" -#define GSS_DBUS_PATH "/org/gnome/ScreenSaver" -#define GSS_DBUS_INTERFACE "org.gnome.ScreenSaver" +#define GSM_DBUS_SERVICE "org.gnome.SessionManager" +#define GSM_DBUS_PATH "/org/gnome/SessionManager" +#define GSM_DBUS_INTERFACE "org.gnome.SessionManager" #endif // make compile on gtk older than 2.10 @@ -565,7 +565,7 @@ void GtkSalFrame::InitCommon() m_pIMHandler = NULL; m_hBackgroundPixmap = None; m_nSavedScreenSaverTimeout = 0; - m_nGSSCookie = 0; + m_nGSMCookie = 0; m_nExtStyle = 0; m_pRegion = NULL; m_ePointerStyle = 0xffff; @@ -1904,8 +1904,9 @@ void GtkSalFrame::setAutoLock( bool bLock ) #ifdef ENABLE_DBUS /** cookie is returned as an unsigned integer */ static guint -dbus_inhibit_gss (const gchar *appname, - const gchar *reason) +dbus_inhibit_gsm (const gchar *appname, + const gchar *reason, + guint xid) { gboolean res; guint cookie; @@ -1921,20 +1922,22 @@ dbus_inhibit_gss (const gchar *appname, return -1; } - /* get the proxy with gnome-screensaver */ + /* get the proxy with gnome-session-manager */ proxy = dbus_g_proxy_new_for_name (session_connection, - GSS_DBUS_SERVICE, - GSS_DBUS_PATH, - GSS_DBUS_INTERFACE); + GSM_DBUS_SERVICE, + GSM_DBUS_PATH, + GSM_DBUS_INTERFACE); if (proxy == NULL) { - g_warning ("Could not get DBUS proxy: %s", GSS_DBUS_SERVICE); + g_warning ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); return -1; } res = dbus_g_proxy_call (proxy, "Inhibit", &error, G_TYPE_STRING, appname, + G_TYPE_UINT, xid, G_TYPE_STRING, reason, + G_TYPE_UINT, 8, //Inhibit the session being marked as idle G_TYPE_INVALID, G_TYPE_UINT, &cookie, G_TYPE_INVALID); @@ -1957,15 +1960,14 @@ dbus_inhibit_gss (const gchar *appname, } static void -dbus_uninhibit_gss (guint cookie) +dbus_uninhibit_gsm (guint cookie) { gboolean res; GError *error = NULL; DBusGProxy *proxy = NULL; DBusGConnection *session_connection = NULL; - /* cookies have to be positive as unsigned */ - if (cookie < 0) { + if (cookie == guint(-1)) { g_warning ("Invalid cookie"); return; } @@ -1978,18 +1980,18 @@ dbus_uninhibit_gss (guint cookie) return; } - /* get the proxy with gnome-screensaver */ + /* get the proxy with gnome-session-manager */ proxy = dbus_g_proxy_new_for_name (session_connection, - GSS_DBUS_SERVICE, - GSS_DBUS_PATH, - GSS_DBUS_INTERFACE); + GSM_DBUS_SERVICE, + GSM_DBUS_PATH, + GSM_DBUS_INTERFACE); if (proxy == NULL) { - g_warning ("Could not get DBUS proxy: %s", GSS_DBUS_SERVICE); + g_warning ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); return; } res = dbus_g_proxy_call (proxy, - "UnInhibit", + "Uninhibit", &error, G_TYPE_UINT, cookie, G_TYPE_INVALID, @@ -1997,12 +1999,12 @@ dbus_uninhibit_gss (guint cookie) /* check the return value */ if (! res) { - g_warning ("UnInhibit method failed"); + g_warning ("Uninhibit method failed"); } /* check the error value */ if (error != NULL) { - g_warning ("Inhibit problem : %s", error->message); + g_warning ("Uninhibit problem : %s", error->message); g_error_free (error); cookie = -1; } @@ -2030,7 +2032,8 @@ void GtkSalFrame::StartPresentation( BOOL bStart ) bPreferBlanking, bAllowExposures ); } #ifdef ENABLE_DBUS - m_nGSSCookie = dbus_inhibit_gss(g_get_application_name(), "presentation"); + m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation", + GDK_WINDOW_XID(m_pWindow->window)); #endif } else @@ -2041,7 +2044,7 @@ void GtkSalFrame::StartPresentation( BOOL bStart ) bAllowExposures ); m_nSavedScreenSaverTimeout = 0; #ifdef ENABLE_DBUS - dbus_uninhibit_gss(m_nGSSCookie); + dbus_uninhibit_gsm(m_nGSMCookie); #endif } } diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index 74394c71e4b2..a8fc6f65d4ee 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -180,7 +180,7 @@ class GtkSalFrame : public SalFrame GdkVisibilityState m_nVisibility; PointerStyle m_ePointerStyle; int m_nSavedScreenSaverTimeout; - guint m_nGSSCookie; + guint m_nGSMCookie; int m_nWorkArea; bool m_bFullscreen; bool m_bSingleAltPress; |