diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-17 09:58:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-17 21:54:14 +0100 |
commit | 946ff7a6768f8207a7d26dfec0f090c08aeabbb9 (patch) | |
tree | 38cad4be0962633dc24d6e288dd267ce9f918a80 | |
parent | ac116d190da9e59b6a8cc541bba652183fccc5b3 (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk/gtksalframe.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/gtk/xid_fullscreen_on_all_monitors.c | 4 |
2 files changed, 7 insertions, 4 deletions
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) |