From 3aef2f430974c3f0aea27afc3f69e552e09c8f20 Mon Sep 17 00:00:00 2001 From: Roman Vasiyarov Date: Wed, 17 Sep 2025 17:44:07 +0300 Subject: [PATCH] chore: XWindowsScreen: remove duplicate function --- src/lib/platform/XWindowsScreen.cpp | 42 +---------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 1a0e8f717..ee83f0901 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -894,47 +894,7 @@ Display *XWindowsScreen::openDisplay(const char *displayName) void XWindowsScreen::saveShape() { // get shape of default screen - m_x = 0; - m_y = 0; - - m_w = WidthOfScreen(DefaultScreenOfDisplay(m_display)); - m_h = HeightOfScreen(DefaultScreenOfDisplay(m_display)); - - // get center of default screen - m_xCenter = m_x + (m_w >> 1); - m_yCenter = m_y + (m_h >> 1); - - // check if xinerama is enabled and there is more than one screen. - // get center of first Xinerama screen. Xinerama appears to have - // a bug when XWarpPointer() is used in combination with - // XGrabPointer(). in that case, the warp is successful but the - // next pointer motion warps the pointer again, apparently to - // constrain it to some unknown region, possibly the region from - // 0,0 to Wm,Hm where Wm (Hm) is the minimum width (height) over - // all physical screens. this warp only seems to happen if the - // pointer wasn't in that region before the XWarpPointer(). the - // second (unexpected) warp causes deskflow to think the pointer - // has been moved when it hasn't. to work around the problem, - // we warp the pointer to the center of the first physical - // screen instead of the logical screen. - m_xinerama = false; -#if HAVE_X11_EXTENSIONS_XINERAMA_H - int eventBase; - int errorBase; - if (XineramaQueryExtension(m_display, &eventBase, &errorBase) && XineramaIsActive(m_display)) { - int numScreens; - XineramaScreenInfo *screens; - screens = XineramaQueryScreens(m_display, &numScreens); - if (screens != nullptr) { - if (numScreens > 1) { - m_xinerama = true; - m_xCenter = screens[0].x_org + (screens[0].width >> 1); - m_yCenter = screens[0].y_org + (screens[0].height >> 1); - } - XFree(screens); - } - } -#endif + setShape(WidthOfScreen(DefaultScreenOfDisplay(m_display)), HeightOfScreen(DefaultScreenOfDisplay(m_display))); } void XWindowsScreen::setShape(int32_t width, int32_t height)