Bug 388647 - kwin (X11) shortcuts loosing "disable" action after HDMI screen unplug
Summary: kwin (X11) shortcuts loosing "disable" action after HDMI screen unplug
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (other bugs)
Version First Reported In: 5.8.7
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-07 13:04 UTC by Jean-Christophe Baptiste
Modified: 2019-04-29 08:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Kwin (2.72 KB, application/zip)
2018-01-07 15:32 UTC, Jean-Christophe Baptiste
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Christophe Baptiste 2018-01-07 13:04:40 UTC
Assigned shortcuts to some desktop effects, like desktop grid or window presentation, stop working correctly after an HDMI unplug event.

For instance, pressing CTRL-F8 shows the desktop grid, and from there, pressing again CTRL-F8 brings back the desktop view.

My environment: 

Kwin 5.8.7-2.1, openSUSE 42.3

To reproduce the issue :

- plug in an external screen (HDMI as far as I could test)
- unplug it
- press CTRL-F8 : the desktop grid is shown
- press CTRL-F8 again : nothing happens

It has 100% reproducibility in my environment.

The workaround so far is to reload kwin after every occurrence of this issue:
Comment 1 Martin Flöser 2018-01-07 15:24:10 UTC
please provide the output of:
qdbus org.kde.KWin /KWin supportInformation

when the issue is present.
Comment 2 Jean-Christophe Baptiste 2018-01-07 15:32:55 UTC
Created attachment 109725 [details]
Kwin
Comment 3 Jean-Christophe Baptiste 2018-01-07 15:33:18 UTC
Here it is, thanks.
Comment 4 Martin Flöser 2018-01-07 16:17:21 UTC
Version
=======
KWin version: 5.8.7
Qt Version: 5.6.2
Qt compile version: 5.6.2
XCB compile version: 1.11.1

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_INPUT: yes
HAVE_DRM: yes
HAVE_GBM: no
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes
HAVE_WAYLAND_EGL: no

X11
===
Vendor: The X.Org Foundation
Vendor Release: 11803000
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.kwin.aurorae
Theme: __aurorae__svg__Breezemite_dark
Blur: 1
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 4
gridUnit: 10
font: Roboto,10,-1,5,75,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

Options
=======
focusPolicy: 0
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 0
legacyFullscreenSupport: false
operationTitlebarDblClick: 5000
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: 16777251
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: 2
colorCorrected: false
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: true
glStrictBindingFollowsDriver: true
glCoreProfile: false
glPreferBufferSwap: 101
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:  yes
Number of Screens: 1

Screen 0:
---------
Name: eDP-1
Geometry: 0,0,1920x1080
Refresh Rate: 60.0079


Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) 
OpenGL version string: 3.0 Mesa 17.0.5
OpenGL platform interface: GLX
OpenGL shading language version string: 1.30
Driver: Intel
GPU class: Unknown
OpenGL version: 3.0
GLSL version: 1.30
Mesa version: 17.0.5
X server version: 1.18.3
Linux kernel version: 4.4.104
Direct rendering: Requires strict binding: yes
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used
Painting blocks for vertical retrace:  no

Loaded Effects:
---------------
zoom
dimscreen
slidingpopups
kwin4_effect_login
slide
screenshot
kwin4_effect_windowaperture
minimizeanimation
kwin4_effect_translucency
flipswitch
desktopgrid
coverswitch
kwin4_effect_morphingpopups
kwin4_effect_maximize
kwin4_effect_fade
presentwindows
highlightwindow
kwin4_effect_dialogparent
blur
contrast
startupfeedback
screenedge
kscreen

Currently Active Effects:
-------------------------
blur
contrast

Effect Settings:
----------------
zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
enableFocusTracking: false
followFocus: true
focusDelay: 350
moveFactor: 20
targetZoom: 1

dimscreen:

slidingpopups:
fadeInTime: 75
fadeOutTime: 125

kwin4_effect_login:

slide:

screenshot:

kwin4_effect_windowaperture:

minimizeanimation:

kwin4_effect_translucency:

flipswitch:
tabBox: false
tabBoxAlternative: false
duration: 100
angle: 30
xPosition: 0.33000001311302185
yPosition: 1
windowTitle: true

desktopgrid:
zoomDuration: 150
border: 10
desktopNameAlignment: 0
layoutMode: 0
customLayoutRows: 2
usePresentWindows: false

coverswitch:
animationDuration: 100
animateSwitch: true
animateStart: true
animateStop: true
reflection: true
windowTitle: true
zPosition: 900
primaryTabBox: false
secondaryTabBox: false

kwin4_effect_morphingpopups:

kwin4_effect_maximize:

kwin4_effect_fade:

presentwindows:
layoutMode: 0
showCaptions: true
showIcons: true
doNotCloseWindows: false
ignoreMinimized: true
accuracy: 20
fillGaps: true
fadeDuration: 75
showPanel: false
leftButtonWindow: 1
rightButtonWindow: 2
middleButtonWindow: 0
leftButtonDesktop: 2
middleButtonDesktop: 0
rightButtonDesktop: 0

highlightwindow:

kwin4_effect_dialogparent:

blur:
blurRadius: 12
cacheTexture: true

contrast:

startupfeedback:
type: 3

screenedge:

kscreen:
Comment 5 Martin Flöser 2018-01-07 16:19:02 UTC
From support information everything looks fine. What about other global shortcuts? Are they still working? Any other where you notice differences?
Comment 6 Jean-Christophe Baptiste 2018-01-07 17:21:39 UTC
Yes, I use quite a lot of shortcuts intensively and they all work well.

Only the second use of these gets ignored.
Comment 7 Martin Flöser 2018-01-08 05:11:20 UTC
And just shortcuts of KWin or are also other applications affected?
Comment 8 Jean-Christophe Baptiste 2018-01-08 07:54:49 UTC
Only kwin, no other shortcut.
I just noticed that if I plug the HDMI screen back, the shortcut works again.
And if I unplug it once more time, again stop working.
Comment 9 Jean-Christophe Baptiste 2018-01-16 17:57:01 UTC
I realized that:

- after entering the desktop grid / windows views, the keyboard stops working. All keys are ignored: ESC to exit, arrows to select other windows or desktops, etc. So it is not only the shortcut like I stated in my first report.

- it can always been reproduced after unplugging the HDMI screen.

- if I re-plug the HDMI right after, without any things else, the keys are again magically recognized.

If it gets too messy, confusing, I can close this and reopen a new issue.
And if a video or something like that can help, let me know.
Comment 10 zccrs 2019-04-29 07:11:20 UTC
Fix in Qt 5.9.0 and KWin 5.10.3

See qtbase: 2b34aefcf02f09253473b096eb4faffd3e62b5f4
See KWin: a6dee74ee455d1da47dd5c9d55a84adbb5e1426a

The reason is that:
When the screen is disconnected, The QDesktopWidget will to delete the QDesktopScreenWidget object corresponding to the screen, which will cause QXcbConnection::removeWindowEventListener to be called, and the event corresponding to the root window will no longer be processed by QXcbConnection.
Comment 11 zccrs 2019-04-29 08:43:40 UTC
I'm sorry. Also need this commit of qtbase: d7a9e08f0ada36ad8ad44651f27a76c9c74e3428

(In reply to zccrs from comment #10)
> Fix in Qt 5.9.0 and KWin 5.10.3
> 
> See qtbase: 2b34aefcf02f09253473b096eb4faffd3e62b5f4
> See KWin: a6dee74ee455d1da47dd5c9d55a84adbb5e1426a
> 
> The reason is that:
> When the screen is disconnected, The QDesktopWidget will to delete the
> QDesktopScreenWidget object corresponding to the screen, which will cause
> QXcbConnection::removeWindowEventListener to be called, and the event
> corresponding to the root window will no longer be processed by
> QXcbConnection.