[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Nov 17 20:54:36 UTC 2017


 vcl/unx/gtk/gtksalframe.cxx                  |    7 ++++---
 vcl/unx/gtk/xid_fullscreen_on_all_monitors.c |    4 +++-
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 946ff7a6768f8207a7d26dfec0f090c08aeabbb9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 17 09:58:24 2017 +0000

    Resolves: tdf#112549 use gtk3 to set gtk2 window fullscreen...
    
    for current monitor mode as well as all-monitors mode
    
    Change-Id: I9de864dc0b416d18937f6ee90f432a8254fe987f
    Reviewed-on: https://gerrit.libreoffice.org/44870
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 2df53d72d878..4d039a0d0759 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -3014,8 +3014,8 @@ gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame )
     GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
 
     //Spawn off a helper program that will attempt to set this fullscreen
-    //window to span all displays.
-    if (pThis->m_bFullscreen && pThis->m_bSpanMonitorsWhenFullscreen)
+    //window either to span all displays or the current monitor
+    if (pThis->m_bFullscreen)
     {
         GdkWindow* gdkwin = widget_get_window(pThis->m_pWindow);
         if (gdkwin)
@@ -3026,7 +3026,8 @@ gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame )
             if (osl::FileBase::getSystemPathFromFileURL(sProgramURL, sProgram) == osl::File::E_None)
             {
                 OString sFinalProgram(OUStringToOString(sProgram, osl_getThreadTextEncoding())
-                    + " " + OString::number((int)GDK_WINDOW_XID(gdkwin)));
+                    + " " + OString::number((int)GDK_WINDOW_XID(gdkwin))
+                    + " " + OString::number((int)pThis->m_bSpanMonitorsWhenFullscreen));
                 OString sDisplay(getDisplayString());
                 if (!sDisplay.isEmpty())
                 {
diff --git a/vcl/unx/gtk/xid_fullscreen_on_all_monitors.c b/vcl/unx/gtk/xid_fullscreen_on_all_monitors.c
index 00554b1df021..558ede597a48 100644
--- a/vcl/unx/gtk/xid_fullscreen_on_all_monitors.c
+++ b/vcl/unx/gtk/xid_fullscreen_on_all_monitors.c
@@ -37,6 +37,7 @@ int main(int argc, char *argv[])
     GdkEvent *event;
     GdkWindow *window;
     int windowid;
+    int spanmonitors;
 
     handle = dlopen("libgtk-3.so.0", RTLD_LAZY);
     if( NULL == handle )
@@ -75,6 +76,7 @@ int main(int argc, char *argv[])
     gtk_init(&argc, &argv);
 
     windowid = atoi(argv[1]);
+    spanmonitors = atoi(argv[2]);
 
     window = gdk_x11_window_foreign_new_for_display(gdk_display_get_default(), windowid);
     if (!window)
@@ -83,7 +85,7 @@ int main(int argc, char *argv[])
         return -1;
     }
 
-    gdk_window_set_fullscreen_mode(window, GDK_FULLSCREEN_ON_ALL_MONITORS);
+    gdk_window_set_fullscreen_mode(window, spanmonitors ? GDK_FULLSCREEN_ON_ALL_MONITORS : GDK_FULLSCREEN_ON_CURRENT_MONITOR);
     gdk_window_fullscreen(window);
 
     while ((event = gdk_event_get()) != NULL)


More information about the Libreoffice-commits mailing list