config_host.mk.in | 1 - configure.ac | 5 ++--- desktop/Executable_oosplash.mk | 2 +- desktop/unx/source/splashx.c | 6 +++--- include/vcl/svapp.hxx | 20 +------------------- include/vcl/syswin.hxx | 2 +- sd/source/ui/dlg/present.cxx | 10 +++------- vcl/Library_vclplug_gen.mk | 4 ++-- vcl/inc/salsys.hxx | 7 ------- vcl/inc/unx/gtk/gtksys.hxx | 1 - vcl/inc/unx/x11/x11sys.hxx | 1 - vcl/source/app/svapp.cxx | 9 --------- vcl/source/window/floatwin.cxx | 2 +- vcl/source/window/menu.cxx | 2 +- vcl/source/window/syswin.cxx | 12 +++--------- vcl/unx/generic/app/saldisp.cxx | 5 ----- vcl/unx/gtk3/gtksys.cxx | 9 --------- vcl/unx/x11/x11sys.cxx | 7 ------- 18 files changed, 18 insertions(+), 87 deletions(-)
New commits: commit 7aca5ee1192b45d05a601946a5c784b8c5bd61bd Author: Noel Grandin <[email protected]> AuthorDate: Thu Jul 20 11:54:52 2023 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Jul 21 11:01:39 2023 +0200 Assume that all modern X servers have a unified display area Change-Id: I704e6147085b2eca7fc6fd93261aced3e04b2fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154667 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index d93e96f6f7d0..60741c13344c 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -981,27 +981,9 @@ public: */ static tools::Rectangle GetScreenPosSizePixel( unsigned int nScreen ); - /** Determines if the screens that make up a display are separate or - form one large display area. - - @returns true when screens form up one large display area windows can be - moved between single screens (e.g. Xserver with Xinerama, Windows) - and false when different screens are separate and windows cannot be moved - between them (e.g. Xserver with multiple screens) - - @see GetBestScreen, GetDisplayBuiltInScreen - */ - static bool IsUnifiedDisplay(); - /** Get the "best" screen. - @returns If IsUnifiedDisplay() == true the return value will be - nearest screen of the target rectangle. - - In case of IsUnifiedDisplay() == false the return value - will always be GetDisplayDefaultScreen(). - - @see IsUnifiedDisplay, GetDisplayBuiltInScreen + @returns the return value will be nearest screen of the target rectangle. */ SAL_DLLPRIVATE static unsigned int GetBestScreen( const tools::Rectangle& ); diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx index 7eee3693bab8..c59d7a24760c 100644 --- a/include/vcl/syswin.hxx +++ b/include/vcl/syswin.hxx @@ -119,7 +119,7 @@ public: SAL_DLLPRIVATE bool isDeferredInit() const { return mbIsDeferredInit; } private: - SAL_DLLPRIVATE void ImplMoveToScreen( tools::Long& io_rX, tools::Long& io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const * i_pConfigureWin ); + static SAL_DLLPRIVATE void ImplMoveToScreen( tools::Long& io_rX, tools::Long& io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const * i_pConfigureWin ); SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox); DECL_DLLPRIVATE_LINK( ImplHandleLayoutTimerHdl, Timer*, void ); diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index a2c39f4e4fed..df7089e25405 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -191,7 +191,6 @@ void SdStartPresentationDlg::InitMonitorSettings() } else { - bool bUnifiedDisplay = Application::IsUnifiedDisplay(); sal_Int32 nExternalIndex = Application::GetDisplayExternalScreen(); sal_Int32 nSelectedIndex (-1); @@ -225,12 +224,9 @@ void SdStartPresentationDlg::InitMonitorSettings() nDefaultExternalIndex = nInsertedEntry; } - if( bUnifiedDisplay ) - { - nInsertedEntry = InsertDisplayEntry( m_xAllMonitors->get_label(), -1 ); - if( nDefaultSelectedDisplay == -1 ) - nSelectedIndex = nInsertedEntry; - } + nInsertedEntry = InsertDisplayEntry( m_xAllMonitors->get_label(), -1 ); + if( nDefaultSelectedDisplay == -1 ) + nSelectedIndex = nInsertedEntry; if (nSelectedIndex < 0) { diff --git a/vcl/inc/salsys.hxx b/vcl/inc/salsys.hxx index 265380a1de2e..a5950441d348 100644 --- a/vcl/inc/salsys.hxx +++ b/vcl/inc/salsys.hxx @@ -39,13 +39,6 @@ public: @returns the number of active screens */ virtual unsigned int GetDisplayScreenCount() = 0; - /* Queries whether multiple screens are part of one bigger display - - @returns true if screens form one big display - false if screens are distinct and windows cannot - be moved between, or span multiple screens - */ - virtual bool IsUnifiedDisplay() { return true; } /* Queries the default screen number. The default screen is the screen on which windows will appear if no special positioning is made. diff --git a/vcl/inc/unx/gtk/gtksys.hxx b/vcl/inc/unx/gtk/gtksys.hxx index 7a70763e9929..31a1bead7bea 100644 --- a/vcl/inc/unx/gtk/gtksys.hxx +++ b/vcl/inc/unx/gtk/gtksys.hxx @@ -26,7 +26,6 @@ public: virtual ~GtkSalSystem() override; static GtkSalSystem *GetSingleton(); - virtual bool IsUnifiedDisplay() override; virtual unsigned int GetDisplayScreenCount() override; virtual unsigned int GetDisplayBuiltInScreen() override; virtual tools::Rectangle GetDisplayScreenPosSizePixel (unsigned int nScreen) override; diff --git a/vcl/inc/unx/x11/x11sys.hxx b/vcl/inc/unx/x11/x11sys.hxx index dcbe459283d1..50c30ac10062 100644 --- a/vcl/inc/unx/x11/x11sys.hxx +++ b/vcl/inc/unx/x11/x11sys.hxx @@ -31,7 +31,6 @@ public: // override pure virtual methods virtual unsigned int GetDisplayScreenCount() override; - virtual bool IsUnifiedDisplay() override; virtual unsigned int GetDisplayBuiltInScreen() override; virtual tools::Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) override; virtual int ShowNativeDialog( const OUString& rTitle, diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 535af17dfb87..e7d88fe41394 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1222,12 +1222,6 @@ unsigned int Application::GetScreenCount() return pSys ? pSys->GetDisplayScreenCount() : 0; } -bool Application::IsUnifiedDisplay() -{ - SalSystem* pSys = ImplGetSalSystem(); - return pSys == nullptr || pSys->IsUnifiedDisplay(); -} - unsigned int Application::GetDisplayBuiltInScreen() { SalSystem* pSys = ImplGetSalSystem(); @@ -1285,9 +1279,6 @@ tools::Long calcDistSquare( const Point& i_rPoint, const tools::Rectangle& i_rRe unsigned int Application::GetBestScreen( const tools::Rectangle& i_rRect ) { - if( !IsUnifiedDisplay() ) - return GetDisplayBuiltInScreen(); - const unsigned int nScreens = GetScreenCount(); unsigned int nBestMatchScreen = 0; unsigned long nOverlap = 0; diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 56a9b06b0471..3aff8ef400c0 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -255,7 +255,7 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, if( bRTL ) // create a rect that can be compared to desktop coordinates devRectRTL = pW->ImplOutputToUnmirroredAbsoluteScreenPixel( normRect ); - if( Application::GetScreenCount() > 1 && Application::IsUnifiedDisplay() ) + if( Application::GetScreenCount() > 1 ) aScreenRect = Application::GetScreenPosSizePixel( Application::GetBestScreen( bRTL ? devRectRTL : devRect ) ); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 2a46a41a12c3..0135a29f4273 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2883,7 +2883,7 @@ bool PopupMenu::PrepareRun(const VclPtr<vcl::Window>& pParentWin, tools::Rectang Size aSz = ImplCalcSize( pWin ); tools::Rectangle aDesktopRect(pWin->GetDesktopRectPixel()); - if( Application::GetScreenCount() > 1 && Application::IsUnifiedDisplay() ) + if( Application::GetScreenCount() > 1 ) { vcl::Window* pDeskW = pWindow->GetWindow( GetWindowType::RealParent ); if( ! pDeskW ) diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 643f83e96ce6..d1071afbfd2c 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -567,15 +567,9 @@ OUString vcl::WindowData::toStr() const void SystemWindow::ImplMoveToScreen( tools::Long& io_rX, tools::Long& io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const * i_pConfigureWin ) { - tools::Rectangle aScreenRect; - if( !Application::IsUnifiedDisplay() ) - aScreenRect = Application::GetScreenPosSizePixel( GetScreenNumber() ); - else - { - aScreenRect = Application::GetScreenPosSizePixel( 0 ); - for( unsigned int i = 1; i < Application::GetScreenCount(); i++ ) - aScreenRect.Union( Application::GetScreenPosSizePixel( i ) ); - } + tools::Rectangle aScreenRect = Application::GetScreenPosSizePixel( 0 ); + for( unsigned int i = 1; i < Application::GetScreenCount(); i++ ) + aScreenRect.Union( Application::GetScreenPosSizePixel( i ) ); // unfortunately most of the time width and height are not really known if( i_nWidth < 1 ) i_nWidth = 50; diff --git a/vcl/unx/gtk3/gtksys.cxx b/vcl/unx/gtk3/gtksys.cxx index 37e32b28b38e..cfa7740c48c7 100644 --- a/vcl/unx/gtk3/gtksys.cxx +++ b/vcl/unx/gtk3/gtksys.cxx @@ -197,15 +197,6 @@ unsigned int GtkSalSystem::GetDisplayScreenCount() #endif } -bool GtkSalSystem::IsUnifiedDisplay() -{ -#if !GTK_CHECK_VERSION(4, 0, 0) - return gdk_display_get_n_screens (mpDisplay) == 1; -#else - return true; -#endif -} - unsigned int GtkSalSystem::GetDisplayBuiltInScreen() { #if GTK_CHECK_VERSION(4, 0, 0) diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx index c354269b3a3d..66a5f2e70fb2 100644 --- a/vcl/unx/x11/x11sys.cxx +++ b/vcl/unx/x11/x11sys.cxx @@ -46,13 +46,6 @@ unsigned int X11SalSystem::GetDisplayScreenCount() pSalDisp->GetXScreenCount(); } -bool X11SalSystem::IsUnifiedDisplay() -{ - SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericUnixSalData()); - unsigned int nScreenCount = pSalDisp->GetXScreenCount(); - return pSalDisp->IsXinerama() || (nScreenCount == 1); -} - unsigned int X11SalSystem::GetDisplayBuiltInScreen() { SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericUnixSalData()); commit 4c00a5bce384c5fa3b46cf5bb29c7e9b1e506ea0 Author: Noel Grandin <[email protected]> AuthorDate: Thu Jul 20 11:27:17 2023 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Jul 21 11:01:29 2023 +0200 Assume that, if we have X11, it supports Xinerama By now, Xinerama is old enough that we can use the X11 server supports it Change-Id: Ida95902916697808c611a53274b1f0299fd298b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154666 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/config_host.mk.in b/config_host.mk.in index 233e2247816c..acb868b8f05f 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -711,7 +711,6 @@ export UNIX_DLAPI_LIBS=@UNIX_DLAPI_LIBS@ export USE_HEADLESS_CODE=@USE_HEADLESS_CODE@ export USE_LD=@USE_LD@ export USE_LIBRARY_BIN_TAR=@USE_LIBRARY_BIN_TAR@ -export USE_XINERAMA=@USE_XINERAMA@ export UPDATE_CONFIG=@UPDATE_CONFIG@ export UUIDGEN=@UUIDGEN@ export VALGRIND_CFLAGS=$(gb_SPACE)@VALGRIND_CFLAGS@ diff --git a/configure.ac b/configure.ac index 8c4977bfd3e5..3ffb5fd42613 100644 --- a/configure.ac +++ b/configure.ac @@ -13572,7 +13572,7 @@ fi AC_SUBST(ENABLE_SILENT_MSI) AC_MSG_CHECKING([whether and how to use Xinerama]) -if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then +if test "$USING_X11" = TRUE; then if test "$x_libraries" = "default_x_libraries"; then XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama` if test "x$XINERAMALIB" = x; then @@ -13626,14 +13626,13 @@ if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:], [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS]) else - AC_MSG_RESULT([no, libXinerama not found or wrong architecture.]) + AC_MSG_ERROR([libXinerama not found or wrong architecture.]) fi else USE_XINERAMA= XINERAMA_LINK=none AC_MSG_RESULT([no]) fi -AC_SUBST(USE_XINERAMA) AC_SUBST(XINERAMA_LINK) AC_MSG_CHECKING([whether to use non-standard RGBA32 cairo pixel order]) diff --git a/desktop/Executable_oosplash.mk b/desktop/Executable_oosplash.mk index 5c7e4ac95bb4..308c76945aef 100644 --- a/desktop/Executable_oosplash.mk +++ b/desktop/Executable_oosplash.mk @@ -23,7 +23,7 @@ $(eval $(call gb_Executable_add_cobjects,oosplash,\ desktop/unx/source/start \ )) -ifneq ($(USE_XINERAMA),) +ifneq ($(USING_X11),) $(eval $(call gb_Executable_add_defs,oosplash,\ -DUSE_XINERAMA \ diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c index afd137d06876..4f7239ab6159 100644 --- a/desktop/unx/source/splashx.c +++ b/desktop/unx/source/splashx.c @@ -16,7 +16,7 @@ #include <X11/Xatom.h> #include <X11/Xutil.h> -#ifdef USE_XINERAMA +#ifdef USING_X11 #include <X11/extensions/Xinerama.h> #endif @@ -406,7 +406,7 @@ static int splash_init_display( struct splash* splash, int argc, char** argv ) { char *display_name = NULL; int i; -#ifdef USE_XINERAMA +#ifdef USING_X11 int n_xinerama_screens = 1; XineramaScreenInfo* p_screens = NULL; #endif @@ -442,7 +442,7 @@ static int splash_init_display( struct splash* splash, int argc, char** argv ) splash->display_x_pos = 0; splash->display_y_pos = 0; -#ifdef USE_XINERAMA +#ifdef USING_X11 p_screens = XineramaQueryScreens( splash->display, &n_xinerama_screens ); if( p_screens ) { diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index 193e9c78f16a..dea289a8e0c5 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -133,7 +133,7 @@ $(eval $(call gb_Library_add_defs,vclplug_gen,\ endif ## handle Xinerama -ifneq ($(USE_XINERAMA),) +ifneq ($(USING_X11),) $(eval $(call gb_Library_add_defs,vclplug_gen,\ -DUSE_XINERAMA_XORG \ )) @@ -146,7 +146,7 @@ $(eval $(call gb_Library_add_libs,vclplug_gen,\ -Wl$(COMMA)-Bstatic -lXinerama -Wl$(COMMA)-Bdynamic \ )) endif -endif # USE_XINERAMA +endif # USING_X11 ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_libs,vclplug_gen,\ diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 2eabfff5a9a5..174aa8761d7d 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -39,10 +39,7 @@ #endif #include <X11/keysym.h> #include <X11/Xatom.h> - -#ifdef USE_XINERAMA_XORG #include <X11/extensions/Xinerama.h> -#endif #include <i18nlangtag/languagetag.hxx> #include <tools/debug.hxx> @@ -2213,7 +2210,6 @@ void SalDisplay::InitXinerama() m_bXinerama = false; return; // multiple screens mean no xinerama } -#if defined(USE_XINERAMA_XORG) if( !XineramaIsActive( pDisp_ ) ) return; @@ -2236,7 +2232,6 @@ void SalDisplay::InitXinerama() m_bXinerama = m_aXineramaScreens.size() > 1; } XFree( pScreens ); -#endif #if OSL_DEBUG_LEVEL > 1 if( m_bXinerama ) {
