SUMMARY desktopPresenceChanged(KWin::Client *client, int desktop) signal does not allow changing the client geometry when using the action menu or by dragging the client between virtual desktops in virtual desktop grid view but it does work correctly when moving clients between virtual desktops using global shortcuts. STEPS TO REPRODUCE 1. open WM console 2. run this small demonstration script ``` workspace.desktopPresenceChanged.connect (function (client) { print('current geometry: x=' + client.geometry.x + ', y=' + client.geometry.y + ', width=' + client.geometry.width + ', height=' + client.geometry.height); var geometry = {x: 100, y: 100, width: 200, height: 200}; client.geometry = geometry; client.opacity = 0.8; }); ``` 3. open a terminal 4. resize and move the terminal such that it's x, y, width and height are not 100, 100, 200 and 200 5a. move the terminal to a different virtual desktop by opening the action menu (default top left corner) and selecting `move to desktop` and move it to any other virtual desktop DIFFERENT SCENARIOS 5b. move the terminal to a different virtual desktop by opening the virtual desktop grid view (default shortcut Ctrl+F8) and then dragging the client to a different virtual desktop 5c. move the terminal to a different virtual desktop by using any of the global shortcuts such as `Switch one desktop down` OBSERVED RESULT 1. if you do step 5a or step 5b you will see that the client does accept the opacity parameter and takes on an opacity of 0.8 but it does not accept the geometry of 100, 100, 200, 200 2. if you do step 5c instead of 5a or 5b you will see that the client correctly accepts the geometry of 100, 100, 200, 200 EXPECTED RESULT 1. expect the client to accept the new geometry supplied just like the opacity but it ignores the geometry when moving clients between virtual desktops using the action menu or virtual desktop grid view SOFTWARE/OS VERSIONS latest ArchLinux packages
KWin internally the difference is that 5a and 5b use Workspace::sendClientToDesktop, 5c marks the window is being moved and then switches the desktop. Please note that 5a/b and 5c are different. 5a/b send a client to a desktop but the desktop doesn't change. 5c sends the client to the desktop and switches to the desktop. Given that I don't think that KWin must behave the same. The scripting API is just exposing KWin internals. Updating the geometry is not always possible.
Interesting, I assumed that they would use the same call to send the client to a different virtual desktop (Workspace::sendClientToDesktop()) but then only add an additional call in case 5c where you call a method to change the current virtual desktop. I can only give you my point of view as an API consumer, but it seems inconsistent to me that connecting to the same signal sometimes does and sometimes doesn't allow changing the geometry of the client. Especially since changing any of the other properties such as opacity is picked up by KWin without a problem. As far as I'm aware, the geometry is currently the only client property that can't be changed when the desktopPresenceChanged(KWin::Client *client, int desktop) signal is invoked in cases 5a/b. In my personal opinion, it would be better if the API did allow changing the geometry in case 5a/b since they are all handled by the same signal from an API consumers point of perspective.
please provide the output of qdbus org.kde.KWin /KWin supportInformation
`qdbus org.kde.KWin /KWin supportInformation` ``` KWin Support Information: The following information should be used when requesting support on e.g. http://forum.kde.org. It provides information about the currently running instance, which options are used, what OpenGL driver and which effects are running. Please post the information provided underneath this introductory text to a paste bin service like http://paste.kde.org instead of pasting into support threads. ========================== Version ======= KWin version: 5.14.5 Qt Version: 5.12.0 Qt compile version: 5.12.0 XCB compile version: 1.13.1 Operation Mode: X11 only Build Options ============= KWIN_BUILD_DECORATIONS: yes KWIN_BUILD_TABBOX: yes KWIN_BUILD_ACTIVITIES: yes HAVE_DRM: yes HAVE_GBM: yes HAVE_X11_XCB: yes HAVE_EPOXY_GLX: yes HAVE_WAYLAND_EGL: yes X11 === Vendor: The X.Org Foundation Vendor Release: 12003000 Protocol Version/Revision: 11/0 SHAPE: yes; Version: 0x11 RANDR: yes; Version: 0x14 DAMAGE: yes; Version: 0x11 Composite: yes; Version: 0x4 RENDER: yes; Version: 0xb XFIXES: yes; Version: 0x50 SYNC: yes; Version: 0x31 GLX: yes; Version: 0x0 Decoration ========== Plugin: org.kde.breeze Theme: Blur: 0 onAllDesktopsAvailable: true alphaChannelSupported: true closeOnDoubleClickOnMenu: false decorationButtonsLeft: 0 decorationButtonsRight: 3, 4, 5 borderSize: 0 gridUnit: 10 font: Noto Sans,10,-1,5,50,0,0,0,0,0,Regular smallSpacing: 2 largeSpacing: 10 Platform ========== Name: KWin::X11StandalonePlatform Options ======= focusPolicy: 1 nextFocusPrefersMouse: true clickRaise: true autoRaise: false autoRaiseInterval: 750 delayFocusInterval: 300 shadeHover: false shadeHoverInterval: 250 separateScreenFocus: false placement: 4 focusPolicyIsReasonable: true borderSnapZone: 10 windowSnapZone: 10 centerSnapZone: 0 snapOnlyWhenOverlapping: false rollOverDesktops: true focusStealingPreventionLevel: 1 legacyFullscreenSupport: false operationTitlebarDblClick: 5015 operationMaxButtonLeftClick: 5000 operationMaxButtonMiddleClick: 5015 operationMaxButtonRightClick: 5014 commandActiveTitlebar1: 0 commandActiveTitlebar2: 30 commandActiveTitlebar3: 2 commandInactiveTitlebar1: 4 commandInactiveTitlebar2: 30 commandInactiveTitlebar3: 2 commandWindow1: 7 commandWindow2: 8 commandWindow3: 8 commandWindowWheel: 31 commandAll1: 10 commandAll2: 3 commandAll3: 14 keyCmdAllModKey: 16777250 showGeometryTip: false condensedTitle: false electricBorderMaximize: true electricBorderTiling: true electricBorderCornerRatio: 0.25 borderlessMaximizedWindows: false killPingTimeout: 5000 hideUtilityWindowsForInactive: true inactiveTabsSkipTaskbar: false autogroupSimilarWindows: false autogroupInForeground: true compositingMode: 1 useCompositing: true compositingInitialized: true hiddenPreviews: 1 glSmoothScale: 0 xrenderSmoothScale: false maxFpsInterval: 16666666 refreshRate: 0 vBlankTime: 6000000 glStrictBinding: false glStrictBindingFollowsDriver: true glCoreProfile: true glPreferBufferSwap: 0 glPlatformInterface: 1 windowsBlockCompositing: true Screen Edges ============ desktopSwitching: false desktopSwitchingMovingClients: false cursorPushBackDistance: 1x1 timeThreshold: 150 reActivateThreshold: 350 actionTopLeft: 0 actionTop: 0 actionTopRight: 0 actionRight: 0 actionBottomRight: 0 actionBottom: 0 actionBottomLeft: 0 actionLeft: 0 Screens ======= Multi-Head: no Active screen follows mouse: no Number of Screens: 1 Screen 0: --------- Name: eDP-1-1 Geometry: 0,0,1920x1080 Scale: 1 Refresh Rate: 59.9339 Compositing =========== Compositing is active Compositing Type: OpenGL OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce 940MX/PCIe/SSE2 OpenGL version string: 3.1.0 NVIDIA 415.25 OpenGL platform interface: GLX OpenGL shading language version string: 1.40 NVIDIA via Cg compiler Driver: NVIDIA Driver version: 415.25 GPU class: Unknown OpenGL version: 3.1 GLSL version: 1.40 X server version: 1.20.3 Linux kernel version: 4.20.1 Direct rendering: Requires strict binding: no GLSL shaders: yes Texture NPOT support: yes Virtual Machine: no OpenGL 2 Shaders are used Painting blocks for vertical retrace: no Loaded Effects: --------------- kwin4_effect_maximize kwin4_effect_dialogparent zoom kwin4_effect_frozenapp kwin4_effect_logout kwin4_effect_morphingpopups kwin4_effect_fade kwin4_effect_fadedesktop kwin4_effect_login kwin4_effect_translucency kwin4_effect_windowaperture slidingpopups screenshot desktopgrid colorpicker presentwindows highlightwindow blur startupfeedback screenedge kscreen Currently Active Effects: ------------------------- blur Effect Settings: ---------------- kwin4_effect_maximize: kwin4_effect_dialogparent: zoom: zoomFactor: 1.2 mousePointer: 0 mouseTracking: 0 enableFocusTracking: false followFocus: true focusDelay: 350 moveFactor: 20 targetZoom: 1 kwin4_effect_frozenapp: kwin4_effect_logout: kwin4_effect_morphingpopups: kwin4_effect_fade: kwin4_effect_fadedesktop: kwin4_effect_login: kwin4_effect_translucency: kwin4_effect_windowaperture: slidingpopups: slideInDuration: 150 slideOutDuration: 250 screenshot: desktopgrid: zoomDuration: 300 border: 10 desktopNameAlignment: 0 layoutMode: 0 customLayoutRows: 2 usePresentWindows: true colorpicker: presentwindows: layoutMode: 0 showCaptions: true showIcons: true doNotCloseWindows: false ignoreMinimized: false accuracy: 20 fillGaps: true fadeDuration: 150 showPanel: false leftButtonWindow: 1 rightButtonWindow: 2 middleButtonWindow: 0 leftButtonDesktop: 2 middleButtonDesktop: 0 rightButtonDesktop: 0 highlightwindow: blur: startupfeedback: type: 1 screenedge: kscreen: ```
Workspace.desktopPresenceChanged signal has been dropped in P6.