Bug 357868 - Closing laptop lid doesn't result in suspend
Summary: Closing laptop lid doesn't result in suspend
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.4.3
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Daniel Vrátil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-11 21:22 UTC by Cameron
Modified: 2022-10-30 00:40 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron 2016-01-11 21:22:28 UTC
Closing the lid of the laptop doesn't result in suspend. The issue is caused by kscreen thinking that the monitor type is unknown. "unknown" type monitors are counted as external (see line 233 at https://github.com/KDE/powerdevil/blob/master/daemon/actions/bundled/handlebuttonevents.cpp) and thus the system won't suspend with the lid closed when an "external" monitor is attached. Configuring power management to ignore externally attached monitors will allow the system to suspend on a laptop lid closed, but then the laptop will of course sleep when the lid is closed even when an external monitor is attached.

The best work around is to select "suspend" from the "Power / Session" menu under the application menu.

~/.xsession-errors shows the following when the lid is closed and :
"powerdevil: Lid action was suppressed because an external monitor is present"

xrandr seems to report the display type correctly looking at the output of 'kscreen-console bug'.

The output for 'QT_LOGGING_RULES="*"  kscreen-console bug':
START: Requesting Config
kscreen: launcherDataAvailable: "org.kde.KScreen.Backend.XRandR"
kscreen: Launcher finished with exit code 1 , status 0
kscreen: Service for requested backend already running
kscreen: Primary output changed from KScreen::Output(Id: 446 , Name: "HDMI-0" ) ( "HDMI-0" ) to KScreen::Output(Id: 446 , Name: "HDMI-0" ) ( "HDMI-0" )
kscreen: Primary output changed from KScreen::Output(Id: 446 , Name: "HDMI-0" ) ( "HDMI-0" ) to KScreen::Output(Id: 446 , Name: "HDMI-0" ) ( "HDMI-0" )
Received config. Took 76 milliseconds
 
========================xrandr --verbose==========================
Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 16384 x 16384
HDMI-0 connected primary 1920x1200+0+0 (0x1bf) normal (normal left inverted right x axis y axis) 518mm x 324mm
        Identifier: 0x1be
        Timestamp:  1304363
        Subpixel:   unknown
        Gamma:      1.0:1.0:1.0
        Brightness: 1.0
        Clones:    
        CRTC:       0
        CRTCs:      1 0 2 3
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
        EDID:
                00ffffffffffff0010ac7aa053544737
                1718010380342078eaee95a3544c9926
                0f5054a1080081408180a940b300d1c0
                010101010101283c80a070b023403020
                360006442100001a000000ff00594d59
                4831343633374754530a000000fc0044
                454c4c2055323431324d0a20000000fd
                00323d1e5311000a20202020202000ed
        BorderDimensions: 4
                supported: 4
        Border: 0 0 0 0
                range: (0, 65535)
        SignalFormat: TMDS
                supported: TMDS
        ConnectorType: HDMI
        ConnectorNumber: 4
        _ConnectorLocation: 4
  1920x1200 (0x1bf) 154.000MHz +HSync -VSync *current +preferred
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  74.04KHz
        v: height 1200 start 1203 end 1209 total 1235           clock  59.95Hz
  1920x1080 (0x1c0) 148.500MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1680x1050 (0x1c1) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1600x1200 (0x1c2) 162.000MHz +HSync +VSync
        h: width  1600 start 1664 end 1856 total 2160 skew    0 clock  75.00KHz
        v: height 1200 start 1201 end 1204 total 1250           clock  60.00Hz
  1280x1024 (0x1c3) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1280x960 (0x1c4) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1024x768 (0x1c5) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x1c6) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  640x480 (0x1c7) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
DP-0 connected (normal left inverted right x axis y axis)
        Identifier: 0x1c8
        Timestamp:  1304363
        Subpixel:   unknown
        Clones:    
        CRTCs:      1 0 2 3
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
        Backlight: 60
                range: (0, 100)
        EDID:
                00ffffffffffff0030e46f0400000000
                0018010495221378eadc95a35855a026
                0d505400000001010101010101010101
                0101010101012e3680a070381f403020
                350058c21000001a522b80a070381f40
                3020350058c21000001a000000fe0033
                38373459803135365746360a00000000
                000041319e001000000a010a20200092
        BorderDimensions: 4
                supported: 4
        Border: 0 0 0 0
                range: (0, 65535)
        SignalFormat: DisplayPort
                supported: DisplayPort
        ConnectorType: Panel
        ConnectorNumber: 5
        _ConnectorLocation: 5
  1920x1080 (0x1c9) 138.700MHz +HSync -VSync +preferred
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  66.68KHz
        v: height 1080 start 1083 end 1088 total 1111           clock  60.02Hz
  1920x1080 (0x1ca) 110.900MHz +HSync -VSync
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  53.32KHz
        v: height 1080 start 1083 end 1088 total 1111           clock  47.99Hz
DP-1 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x1cb
        Timestamp:  1304363
        Subpixel:   unknown
        Clones:    
        CRTCs:      1 0 2 3
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
        BorderDimensions: 4
                supported: 4
        Border: 0 0 0 0
                range: (0, 65535)
        SignalFormat: DisplayPort
                supported: DisplayPort
        ConnectorType: DisplayPort
        ConnectorNumber: 7
        _ConnectorLocation: 7
DP-2 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x1cc
        Timestamp:  1304363
        Subpixel:   unknown
        Clones:    
        CRTCs:      1 0 2 3
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
        BorderDimensions: 4
                supported: 4
        Border: 0 0 0 0
                range: (0, 65535)
        SignalFormat: TMDS
                supported: TMDS
        ConnectorType: DisplayPort
        ConnectorNumber: 7
        _ConnectorLocation: 7
DP-3 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x1cd
        Timestamp:  1304363
        Subpixel:   unknown
        Clones:    
        CRTCs:      1 0 2 3
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
        BorderDimensions: 4
                supported: 4
        Border: 0 0 0 0
                range: (0, 65535)
        SignalFormat: DisplayPort
                supported: DisplayPort
        ConnectorType: DisplayPort
        ConnectorNumber: 8
        _ConnectorLocation: 8
DP-4 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x1ce
        Timestamp:  1304363
        Subpixel:   unknown
        Clones:    
        CRTCs:      1 0 2 3
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
        BorderDimensions: 4
                supported: 4
        Border: 0 0 0 0
                range: (0, 65535)
        SignalFormat: TMDS
                supported: TMDS
        ConnectorType: DisplayPort
        ConnectorNumber: 8
        _ConnectorLocation: 8
 
========================Outputs===================================
Screen:
        maxSize: QSize(16384, 16384)
        minSize: QSize(8, 8)
        currentSize: QSize(1920, 1200)
 
-----------------------------------------------------
 
Id:  446
Name:  "HDMI-0"
Type:  "Unknown"
Connected:  true
Enabled:  true
Primary:  true
Rotation:  1
Pos:  QPoint(0,0)
MMSize:  QSize(518, 324)
Size:  QSize(1920, 1200)
Clones:  None
Mode:  "447"
Preferred Mode:  "447"
Preferred modes:  ("447")
Modes:
         "447"    ""   QSize(1920, 1200)   59.9502
         "448"    ""   QSize(1920, 1080)   60
         "449"    ""   QSize(1680, 1050)   59.9543
         "450"    ""   QSize(1600, 1200)   60
         "451"    ""   QSize(1280, 1024)   60.0197
         "452"    ""   QSize(1280, 960)   60
         "453"    ""   QSize(1024, 768)   60.0038
         "454"    ""   QSize(800, 600)   60.3165
         "455"    ""   QSize(640, 480)   59.9405
EDID Info:
        Device ID:  "xrandr-Dell Inc.-DELL U2412M-YMYH14637GTS"
        Name:  "DELL U2412M"
        Vendor:  "Dell Inc."
        Serial:  "YMYH14637GTS"
        EISA ID:  ""
        Hash:  "10c8ec85e70a375c30998498de0694ef"
        Width:  52
        Height:  32
        Gamma:  2
        Red:  QQuaternion(scalar:1, vector:(0.639648, 0.328125, 0))
        Green:  QQuaternion(scalar:1, vector:(0.299805, 0.599609, 0))
        Blue:  QQuaternion(scalar:1, vector:(0.150391, 0.0595703, 0))
        White:  QQuaternion(scalar:1, vector:(0.313477, 0.329102, 0))
 
-----------------------------------------------------
 
Id:  456
Name:  "DP-0"
Type:  "Unknown"
Connected:  true
Enabled:  false
Primary:  false
Rotation:  1
Pos:  QPoint(0,0)
MMSize:  QSize(344, 194)
Clones:  None
Mode:  ""
Preferred Mode:  "457"
Preferred modes:  ("457")
Modes:
         "457"    ""   QSize(1920, 1080)   60.0204
         "458"    ""   QSize(1920, 1080)   47.9904
EDID Info:
        Device ID:  "xrandr-unknown"
        Name:  ""
        Vendor:  ""
        Serial:  ""
        EISA ID:  "3874Y�156WF6"
        Hash:  "d190c7f760f9f4048be22a81e23a066e"
        Width:  34
        Height:  19
        Gamma:  2
        Red:  QQuaternion(scalar:1, vector:(0.639648, 0.34375, 0))
        Green:  QQuaternion(scalar:1, vector:(0.334961, 0.625, 0))
        Blue:  QQuaternion(scalar:1, vector:(0.150391, 0.0517578, 0))
        White:  QQuaternion(scalar:1, vector:(0.313477, 0.329102, 0))
 
-----------------------------------------------------
 
Id:  459
Name:  "DP-1"
Type:  "Unknown"
Connected:  false
 
-----------------------------------------------------
 
Id:  460
Name:  "DP-2"
Type:  "Unknown"
Connected:  false
 
-----------------------------------------------------
 
Id:  461
Name:  "DP-3"
Type:  "Unknown"
Connected:  false
 
-----------------------------------------------------
 
Id:  462
Name:  "DP-4"
Type:  "Unknown"
Connected:  false
 
========================Configurations============================
Configs in:  "/home/hiryu/.local/share/kscreen/"
Number of files:  2
 
"03495a4d81145434dcad5eff2a3987e1"
""
 
"f67ff9cf3e387cc1f9c932b630f112f0"
""


No external monitors are connected.

Not only should kscreen detect the monitor type correctly here, but probably powerdevil should suspend if there's only a single unknown monitor attached as well.



Reproducible: Always

Steps to Reproduce:
1. Have a laptop screen that kscreen detects as type "unknown"
2. Make sure "Even when an external monitor is connected" is unchecked under the Power Management settings.
3. Close the laptop lid.



Actual Results:  
Laptop doesn't suspend.

Expected Results:  
Laptop should be suspended.
Comment 1 Daniel Vrátil 2016-01-11 22:52:03 UTC
Git commit fefe2878f5c204fa01306e9e6c60045295ef66a0 by Daniel Vrátil.
Committed on 11/01/2016 at 22:51.
Pushed by dvratil into branch 'Plasma/5.5'.

Don't consider Unknown output to be an external monitor

When laptop screen gets reported as 'Unknown', assume it's a laptop screen
and not an external screen, so that suspend-on-lid-close does not get disabled.

REVIEW: 126721

M  +1    -1    daemon/actions/bundled/handlebuttonevents.cpp

http://commits.kde.org/powerdevil/fefe2878f5c204fa01306e9e6c60045295ef66a0
Comment 2 Kai Uwe Broulik 2016-03-07 16:48:12 UTC
Git commit d3162725cfffb79da7bb8f276a31a915e3349dab by Kai Uwe Broulik, on behalf of Daniel Vrátil.
Committed on 07/03/2016 at 16:47.
Pushed by broulik into branch 'Plasma/5.6'.

Don't consider Unknown output to be an external monitor

When laptop screen gets reported as 'Unknown', assume it's a laptop screen
and not an external screen, so that suspend-on-lid-close does not get disabled.

(This commit was never merged from 5.5 to master apparently)

REVIEW: 126721
(cherry picked from commit fefe2878f5c204fa01306e9e6c60045295ef66a0)

M  +1    -1    daemon/actions/bundled/handlebuttonevents.cpp

http://commits.kde.org/powerdevil/d3162725cfffb79da7bb8f276a31a915e3349dab
Comment 3 Cameron 2016-03-07 18:09:06 UTC
I assumed it was merged because this started working for me (I'm currently using 5.5.4-0ubuntu1~ubuntu15.10~ppa1).

Only issue is now the screen goes to sleep even with an external monitor attached. There's an option you can set that tells kscreen to suspend even if an external monitor is attached... I triple checked that this option is unset, so the system going to sleep when I close the lid with an external monitor is definitely a bug and should probably be filed separately once I have the time.
Comment 4 Jarl Friis 2016-11-13 11:06:03 UTC
I have just been affected by this bug when upgrading from Kubuntu 16.04 to 16.10

Kubuntu 16.10 is running KDE Plasma 5.7.5

Do you need any other info?
Comment 5 marco 2017-01-20 16:19:27 UTC
Same bug with 
plasma and powerdevil 5.8.3 on Gentoo

When i close the lid i have this log in  .xsession-errors 

powerdevil: Lid action was suppressed because an external monitor is present


no suspend to ram happened and the kscreen-console output is:

========================xrandr --verbose==========================

========================Outputs===================================
Screen:
        maxSize: QSize(16384, 16384)
        minSize: QSize(8, 8)
        currentSize: QSize(1920, 1080)

-----------------------------------------------------

Id:  542
Name:  "DP-0"
Type:  "DisplayPort"
Connected:  false

-----------------------------------------------------

Id:  543
Name:  "DP-1"
Type:  "DisplayPort"
Connected:  false

-----------------------------------------------------

Id:  544
Name:  "DP-2"
Type:  "DisplayPort"
Connected:  false

-----------------------------------------------------

Id:  545
Name:  "DP-3"
Type:  "DisplayPort"
Connected:  false

-----------------------------------------------------

Id:  546
Name:  "DP-4"
Type:  "DisplayPort"
Connected:  true
Enabled:  true
Primary:  true
Rotation:  1
Pos:  QPoint(0,0)
MMSize:  QSize(344, 194)
Size:  QSize(1920, 1080)
Clones:  None
Mode:  "547"
Preferred Mode:  "547"
Preferred modes:  ("547")
Modes: 
         "547"    ""   QSize(1920, 1080)   60.0204
         "548"    ""   QSize(1920, 1080)   47.9971
EDID Info: 
        Device ID:  "xrandr-unknown"
        Name:  ""
        Vendor:  ""
        Serial:  ""
        EISA ID:  "LP156WF6-SPK"
        Hash:  "adb55718268e05f7409f306cbdcbba5f"
        Width:  34
        Height:  19
        Gamma:  2
        Red:  QQuaternion(scalar:1, vector:(0.580078, 0.347656, 0))
        Green:  QQuaternion(scalar:1, vector:(0.339844, 0.55957, 0))
        Blue:  QQuaternion(scalar:1, vector:(0.155273, 0.125, 0))
        White:  QQuaternion(scalar:1, vector:(0.313477, 0.329102, 0))

-----------------------------------------------------

Id:  549
Name:  "DP-5"
Type:  "DisplayPort"
Connected:  false

-----------------------------------------------------

Id:  550
Name:  "DP-6"
Type:  "DisplayPort"
Connected:  false

========================Configurations============================
Comment 6 Justin Zobel 2022-10-30 00:37:26 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 7 Cameron 2022-10-30 00:40:32 UTC
I believe this is the bug that was fixed many years ago. It was related to "null displays" in Qt. Qt was never supposed to return null displays during this era or something like that, but many more cases were being found. It has long since been resolved.