Page MenuHomePhabricator

Hotplug display issues - Enlightenment 0.24.0
Open, Incoming QueuePublic

Description

I am having a variety of related issues as a result of the hotplug display changes in E 0.24.0. Prior to 0.24.0, I had a script I would run via an icon on my desktop to turn my laptop display on/off, as well as my external display via xrandr. The script no longer works with 0.24.0 due to the hotplug changes. Anytime I turn off a display with xrandr, E turns it back on. That is fine, providing the following issues can be addressed.

  1. When I first plug in an external display that has a different resolution than my laptop display, it changes the desktop portion of my laptop, but leaves the screen resolution unchanged and the shelve remains centered in the screen. See the following screenshot, you will noticed the black area. The mouse and windows can still go there, but the wallpaper and desktop icons cannot. That is new with 0.24.0

  1. After plugging in an external display to my laptop, sometimes I can close the lid and the laptop will not suspend, other times it will suspend. I cannot figure out the order. It seems to be related to being plugged into power rather than running on battery, but that is not consistent. At times, when I close the lid to my laptop, I get a popup that E is busy with another request and is in the process of suspending, when it is not. See the following screenshot. Once that popup comes up, I cannot log out, restart/reboot, or any other system actions. I cannot even switch to another VT via CTRL-ALT. It does seem to go away and restore system actions and suspend when I unplug the external display.

  1. Sometimes after unplugging the external display, when I close the lid on my laptop, it does not suspend. Other times, it does suspend, or the ability to suspend on lid closure is restored. It is very inconsistent, and I cannot figure out the order.

There seems to be some order with the laptop being plugged into power and plugging in an external display. If things get out of sync, lid closure with external display plugged in suspends, rather than just turning off the laptop display. Other times, it works as intended and I can close my laptop lid without suspending with external monitor.

For #3, if I unplug the external display before I unplug from power, that seems to restore the ability to suspend on lid closure. It is more #2 that does not work consistently. Plugging in external display, when laptop is plugged into power, close lid and laptop suspends. In addition to #1 that happens all the time.

If I reboot, and before E starts I close the laptop lid or it is already closed, then it starts with only my external display. The changes do seem to work at times, and are very nice overall. Once things are working as intended, there will be no need for the script I used to run to toggle displays on/off. Until then, it is driving me crazy as I do not seem to have any control over the displays or suspension on lid closure. Nor can I figure out the order to get things to work as intended.

On a side note, for the first time, my laptop display and external display will go to sleep with synergy running. That has not happened with any other desktop I have run. The only issue there is, if the mouse/cursor is on that display controlled via synergy from another system, the backlight remains on. If the cursor is not there, the backlight turns off. No clue if that is related to the changes or not, but I am pleased that my laptop displays turn off while synergy is running.

Thank you for your consideration of these issues, and for your time in confirming and resolving.

wltjr created this task.May 22 2020, 1:47 PM

eh wait.. first lines. you had a script run... why? you know this is a recipe for disaster as e is messing with randr config at the same time as your script... it's a race condition waiting to happen. so i wouldn't do this if i were you...

When I first plug in an external display

this first is the first time ever - a new screen you have never configured before? Or is it every time you plug it in after configuring it?

After plugging in an external display to my laptop, sometimes I can close the lid and the laptop will not suspend, other times it will suspend. I cannot figure out the order.

well that depends on the action bound to lid close. if it's "suspend intelligently" then the logic is that if there is an external screen plugged in and active displaying stuff at the time, the lid close will not suspend. this is by design - the idea is you can dock your laptop and close the lid and then use external kbd/mouse/screen "like a desktop" and it won't go suspending on you. i don't know if there is a race condition happening there where e hasn't yet responded to the plug-in of the external screen thus it doesn't think there is one yet and thus suspends. so first double check on a race and do it slowly step by step - plug in screen. wait for it to come on. then close lid. it should be reliable then. it's a kind of race you can't easily get rid of because no matter what events like plug/unplug and async. i could reduce it by having everything delayed - always. so response to suspend on lid close - wait longer than it will take for e to possibly see a new display connector event and then respond.

reality is that a lot of this has gotten to be a hairy ball over the years strting from a simple "on lid close event, suspend) and needs a clean-up. it needs a bunch of desired states with priorities (like desire suspend because lid closed, but desire wake because external display. the external display desire is more important than the suspend on lid close desire. need similar logic for ac plug/unplug too and "user requested to suspend explicitly" and need to weigh up all the desired states then when events happen re-evaluate the current desired state - but probably after a delay to let things "settle". this is on a mental todo list along with redoing the config dialogs so power management can all come under a single umbrella. throw in not just suspend/hibernate but also possible things like shutdown and cpufreq and screen brightness. maybe you want the system to shut down on lid close? you want cpu frequency and power management to force a lower max clock and/or power down certain usb or pice devices or disks depending on current system state.

so overall i see a redesign pending for this with possibly a bunch of system power states which define either a suspend or hibernate or then cpufreq profile + screen brightness + dim timeout + dim level etc. and maybe 3 or 5 of these states (maybe user defined) then a given bunch of inputs requesting some desired state level. they probably will be like a "power state" 0 -> 1.0 or 0 -> 100 with 0 == halt, 10 == hibernate, 20 == suspend, 30 == zero clock stay alive but power down lots of devices and only keep some critical things like bt, wifi, network alive but screens off and cpu set to a zero-clock-like mode, 40 == screen on at very low dim, cpufreq at very low values not allowing much clocking up, 50 == regular dim levels, cpufreq allowed to come up for spikes, 80 == screens all at max brightness, all devices alive and regular, cpufreq allowed to go up to max but still drop to power saving, and 100 == cpufreq locked in at max, screens all on etc. etc. (e.g. "game mode"). and then really the systems trying to pick a level based on some vetos (like cpu has to be alive and can't be asleep. communications has to be alive to get emails, display must be alive to see things, etc.)...

I cannot even switch to another VT via CTRL-ALT. It does seem to go away and restore system actions and suspend when I unplug the external display.

this is x right? ... if so this means your xserver has somehow locked up. it shouldn't but vt switching is handled internally by the xserver no matter what clients do. unless the xserver has hit some kind of bug...

Sometimes after unplugging the external display, when I close the lid on my laptop, it does not suspend. Other times, it does suspend, or the ability to suspend on lid closure is restored. It is very inconsistent, and I cannot figure out the order.

is the other screen somehow still alive? like move mouse to where it should be and mouse disappears off screen( assuming a side-by-side setup - if its a clone well you need to double-check screen setup dialog or xrandr output to tel you the state).?

eh wait.. first lines. you had a script run... why? you know this is a recipe for disaster as e is messing with randr config at the same time as your script... it's a race condition waiting to happen. so i wouldn't do this if i were you...

It is a legacy script that was necessary before E 0.24.0. I used it with Plasma/KDE before E. I am pleased with the direction E is heading, and the hotplug display will make my script obsolete. Plus, with the changes, my script no longer works, E reverts the changes.

this first is the first time ever - a new screen you have never configured before? Or is it every time you plug it in after configuring it?

It is a display I have been using for years. When I make changes to the settings, they do not seem to remain, sometimes. They also negate other changes. I have it set to extend, but it was cloning. After revisiting settings, it is not extended, but opposite of what it was with 0.23.x and prior versions. Before my external display was the extended screen, now its my laptop. That is moot, as I usually have the laptop display turn off, which I will be doing via lid closure with 0.24.0+

well that depends on the action bound to lid close. if it's "suspend intelligently" then the logic is that if there is an external screen plugged in and active displaying stuff at the time, the lid close will not suspend. this is by design - the idea is you can dock your laptop and close the lid and then use external kbd/mouse/screen "like a desktop" and it won't go suspending on you.

Yes, I should be able to close the laptop lid without suspend, but that does not seem to be the case. Even as I write this now, there is nothing on my laptop display, the extended display. Everything is on my external display. Closing laptop lid suspends the system instead of turning off laptop monitor.

i don't know if there is a race condition happening there where e hasn't yet responded to the plug-in of the external screen thus it doesn't think there is one yet and thus suspends. so first double check on a race and do it slowly step by step - plug in screen. wait for it to come on. then close lid. it should be reliable then.

That is what I do and it still suspends more times than not. When lid closure does not suspend, it seems like there is some order with plugging in power and the external display. Assuming being plugged into power instead of being on battery is part of the hotplug logic at all. I have tried a variety of things, but I cannot get it to reliably turn off laptop display without suspending on lid closure no matter the order of plugging in power or the external display.

it's a kind of race you can't easily get rid of because no matter what events like plug/unplug and async. i could reduce it by having everything delayed - always. so response to suspend on lid close - wait longer than it will take for e to possibly see a new display connector event and then respond.

E seems to be responding correctly to the display being plugged in and unplugged. The displays fade, it turns on the external, and when I unplug it turns that off and reverts things back to my laptop. Like the black area in the screenshot in my initial comment, that goes away when I unplug. All the hotplug display seems to be working, except the lid closure aspect. E seems to know there is an external display, its just having a hard time disabling the suspend on laptop lid closure.

reality is that a lot of this has gotten to be a hairy ball over the years strting from a simple "on lid close event, suspend) and needs a clean-up. it needs a bunch of desired states with priorities (like desire suspend because lid closed, but desire wake because external display. the external display desire is more important than the suspend on lid close desire

I only care about suspend on lid closure when I do not have an external display. If I have an external display connected, the only time i want it to suspend is if it is running on battery, and is about to go below a threshold 20%. But that has nothing to do with lid closure, just battery power. If plugged into power and also external display plugged in, I never want the lid closure to suspend the laptop.

need similar logic for ac plug/unplug too and "user requested to suspend explicitly" and need to weigh up all the desired states then when events happen re-evaluate the current desired state - but probably after a delay to let things "settle".

Yes, the ability for user to suspend regardless of external display, plugged into power, and/or laptop lid closure should remain. I get it is a tricky thing to accomplish, with lots of different events to trigger different things under different conditions.

this is on a mental todo list along with redoing the config dialogs so power management can all come under a single umbrella. throw in not just suspend/hibernate but also possible things like shutdown and cpufreq and screen brightness. maybe you want the system to shut down on lid close? you want cpu frequency and power management to force a lower max clock and/or power down certain usb or pice devices or disks depending on current system state.

Yes, some might want to lid closure to suspend regardless of external display. It is a complex mess, I do appreciate you tackling.

so overall i see a redesign pending for this with possibly a bunch of system power states which define either a suspend or hibernate or then cpufreq profile + screen brightness + dim timeout + dim level etc. and maybe 3 or 5 of these states (maybe user defined) then a given bunch of inputs requesting some desired state level.

That all sounds good. In the mean time, I am just providing feedback from the hotplug display changes in 0.24.0 and turning off my laptop display via some means.

I cannot even switch to another VT via CTRL-ALT. It does seem to go away and restore system actions and suspend when I unplug the external display.

this is x right? ... if so this means your xserver has somehow locked up. it shouldn't but vt switching is handled internally by the xserver no matter what clients do. unless the xserver has hit some kind of bug...

Yes running under X. When I am unable to switch VT, I lose all system actions, usually getting that suspend popup. Everything else is fully functional, X is not locked up I can open new windows, do stuff, etc. That is also the only time I can close the laptop lid without the system suspending. I seem to lose all system actions and ability to switch VT anytime I am able to close laptop lid without suspending, but nothing else is affected. It is one or the other, rarely both. The only time I have both is when I boot or start E with the laptop lid already close.

Sometimes after unplugging the external display, when I close the lid on my laptop, it does not suspend. Other times, it does suspend, or the ability to suspend on lid closure is restored. It is very inconsistent, and I cannot figure out the order.

is the other screen somehow still alive? like move mouse to where it should be and mouse disappears off screen( assuming a side-by-side setup - if its a clone well you need to double-check screen setup dialog or xrandr output to tel you the state).?

When it does work, using external display with laptop lid closed, the laptop display is not active. I cannot move my mouse there, not until I unplug the external display, then it reverts back to laptop, with lid closed or open.

If I turn off the laptop display in settings, I can still move the mouse and windows there. But I do not think I should be turning off the laptop display there, that was just an experiment. I tried changing the lid options in screen settings and other settings as experiments.

It does not seem to matter if it is cloned or extended, or if anything is on the display, cursor active, etc. I cannot figure out how to reliable use an external display and close my laptop display without suspend. Thus opening the issue.

ok - i just spent about 10 mins with my laptop, an external display on my desk doing various combinations of plug and unplug of the external display, closing of the lid and plug/unplug of power. in every case i ended up after a few seconds and some fade out and in etc. with either my external monitor showing my previous laptop display (lid closed) or both screens showing 2 different screen configs (mouse can move from one to the other). my monitor is a different res (2560x1440 vs 1920x1080 on laptop screen) so it adjusted accordingly each and every time. i also tried plugging and unplugging of ac during this process as well ... never did it suspend except in the case of external screen unplugged and ac unplugged and i close the lid then. ... so i can't reproduce your issues. i don't know what causes them... i was guessing above at a race. i did try the above from slowly and methodically plug/unplug one thing at a time to being a bit rushed about it. sooo... :(.

i don't know what to do ... i can't fix something i can't reproduce. i'm taking guesses above at what maybe is a hole you might fall through. i can't manage to fall through it, so i can't find it. i do know our general power state handling needs to be redone as i mentioned because it started off really simple and has grown more and more features one at a time to the point of needing a re-do as i described, but... right now i seem unable to find that logic hole. :(

wltjr added a comment.May 26 2020, 9:11 AM

ok - i just spent about 10 mins with my laptop, an external display on my desk doing various combinations of plug and unplug of the external display, closing of the lid and plug/unplug of power. in every case i ended up after a few seconds and some fade out and in etc. with either my external monitor showing my previous laptop display (lid closed) or both screens showing 2 different screen configs (mouse can move from one to the other). my monitor is a different res (2560x1440 vs 1920x1080 on laptop screen) so it adjusted accordingly each and every time.

I am not seeing the background and desktop icons not filling the display when plugging in an external monitor anymore. Not since I went back to the external monitors settings and set it to be left of my laptop display. But I continue to experience suspending issues, which are getting worse.

i also tried plugging and unplugging of ac during this process as well ... never did it suspend except in the case of external screen unplugged and ac unplugged and i close the lid then. ... so i can't reproduce your issues. i don't know what causes them... i was guessing above at a race. i did try the above from slowly and methodically plug/unplug one thing at a time to being a bit rushed about it. sooo... :(.

There is definitely something going wrong with plugging and unplugging power. I have rebooted my laptop twice this morning. I have yet to plug in an external display. After the reboot, I was able to close lid and suspend. But, after unplugging and plugging in power again. I am getting that popup that disables all systems actions, reboot, VT switching, etc. That clearly seems to have something to do with power, as I have not plugged in a external display at all. Just plugged and unplugged power.

i don't know what to do ... i can't fix something i can't reproduce. i'm taking guesses above at what maybe is a hole you might fall through. i can't manage to fall through it, so i can't find it. i do know our general power state handling needs to be redone as i mentioned because it started off really simple and has grown more and more features one at a time to the point of needing a re-do as i described, but... right now i seem unable to find that logic hole. :(

I understand about not being able to fix if you cannot reproduce. I wish I knew how to replicate it for you, because it is quite annoying and frustrating. I might have to revert back to 0.23.0. It is not practical to keep having to reboot my laptop to either use external monitor with lid closed, or restore my ability to suspend when lid is closed without any external monitor.

It very well could be more power related than external monitor. Since I am having suspend issues without an external monitor. Right now I can close my laptop lid, and it will not suspend. Early this morning when I lifted my lid and un-suspended it, and plugged in power, the display was dimming and coming back with every action. I had to reboot to clear that out. Now anytime I close the lid, I get that popup, each time I close the lid. I had like 3 a bit ago.

It might be best to close this issue and start a new one. It is looking like most of my issues are power related as opposed to hotplug display. I am having less display issues, the issues are more related to suspend and inability to do anything system action wise. I thought hotplug display was causing that issue, but after my experiences without any external display attached. It is looking more and more like something to do with plugging and unplugging power, or something do to with that rather than display.

can you just try the default theme? the suspend and other things rely on a back and forth talk between e and the theme. perhaps your theme never responds with a "i am done" signal and you end up down some never-tested error path? i'm guessing.

also can you run acpi_listen somewhere in a terminal to get logs - this should log ac power plug/unplug... i am curious to see if acpi is reporting events properly...

wltjr added a comment.May 26 2020, 7:01 PM

Ok, just to try things one at a time. I switched to the default them. I rebooted. I do not have an external display connected. When I booted up, I was plugged into power. I closed the lid and it suspended. I then opened the lid to un-suspend. Then, I unplugged power, closed the lid and boom.

I just ran acpi_listen, per your request, that seems to be fine, it even detects lid close/open.

wlt ~
# acpi_listen

ac_adapter ACPI0003:00 00000080 00000000
battery PNP0C0A:00 00000080 00000001
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
processor LNXCPU:02 00000081 00000000
processor LNXCPU:03 00000081 00000000


battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000001
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
processor LNXCPU:02 00000081 00000000
processor LNXCPU:03 00000081 00000000


button/lid LID close
button/lid LID open

That was all with the default them. I think it is safe for me to switch back. I think that can rule out the theme aspect. That would be interesting if it was the theme. It does seem to definitely be something with power and not the external display.

I really appreciate your time on this! It is a new issue with 0.24.0, where ever it is coming from. Not sure why it is only affecting me. My laptop is a Lenovo Yoga 14 20fy. I have an older HP I can try, but the battery is dead, so I would need to get a new one to see plugging and unplugging power has the same affect there.

do you have multiple bindings for lid close in acpi bindings? what have you done to have it suspend on lid close even with ac on? in blanking enabled "suspend even on c" (i know bad place for this checkbox... as above - whole thing needs a redo). it's almost as if you have 2 acpi lid close bindings? i did exactly what you describe above without issues - i could get it to suspend when on ac by checking the checkbox above. check your acpi bindings as you definitely get the acpi events i''d expect.

so just for detail. we have 2 sleep bindings out of the box. 1 is an explicit sleep acpi event:

group "E_Config_Binding_Acpi" struct {
    value "context" int: 0;
    value "type" int: 8;
    value "status" int: -1;
    value "action" string: "suspend";
    value "params" string: "now";
}

that matches the enum in e_acpi.h:

E_ACPI_TYPE_SLEEP, // 8

also we have:

group "E_Config_Binding_Acpi" struct {
    value "context" int: 0;
    value "type" int: 5;
    value "status" int: 1;
    value "action" string: "suspend_smart";
    value "params" string: "now";
}

that matches the lid event:

E_ACPI_TYPE_LID, // 5

there is also hibernate:

group "E_Config_Binding_Acpi" struct {
    value "context" int: 0;
    value "type" int: 12;
    value "status" int: -1;
    value "action" string: "hiberate";
    value "params" string: "now";
}

which matches:

E_ACPI_TYPE_HIBERNATE, // 12

now ... unless you also have keybindings being triggered:

group "E_Config_Binding_Key" struct {
    value "context" int: 9;
    value "modifiers" int: 0;
    value "key" string: "XF86Standby";
    value "action" string: "suspend";
    value "params" string: "now";
    value "any_mod" uchar: 0;
}

group "E_Config_Binding_Key" struct {
    value "context" int: 9;
    value "modifiers" int: 0;
    value "key" string: "XF86Sleep";
    value "action" string: "suspend";
    value "params" string: "now";
    value "any_mod" uchar: 0;
}

group "E_Config_Binding_Key" struct {
    value "context" int: 9;
    value "modifiers" int: 0;
    value "key" string: "XF86PowerDown";
    value "action" string: "hibernate";
    value "params" string: "now";
    value "any_mod" uchar: 0;
}

group "E_Config_Binding_Key" struct {
    value "context" int: 9;
    value "modifiers" int: 0;
    value "key" string: "XF86Suspend";
    value "action" string: "suspend";
    value "params" string: "now";
    value "any_mod" uchar: 0;
}

group "E_Config_Binding_Key" struct {
    value "context" int: 9;
    value "modifiers" int: 0;
    value "key" string: "XF86Hibernate";
    value "action" string: "hibernate";
    value "params" string: "now";
    value "any_mod" uchar: 0;
}

does your laptop somehow produce both a lid event AND some kind of explicit "sleep" keypress? there doesn't seem to be an acpi event for it in your log above... do you have maybe something like "suspend when below" and like 5% or something in the battery gadget settings? (again - yes. a mess. thus the above cleanup)? can you hunt round for any setting that may be causing it to try suspend and disable/remove them to try identify if multiple are being triggered? so by elimination?

what would explain your experience would be a laptop that somehow is producing a "sleep key pressed" whenever lid is closed as some kind of hack/workaround no normal lid management. i do not see that on my laptops. they behave "normally" and don't try and second-guess the OS. just wondering if it's this and this would explain the multiple system actions etc. ... and getting stuck in this state is the "untested error path" that you just shouldn't be getting into to begin with... :) but i need to understand what is going on with your system there to know what to possibly do...

wltjr added a comment.May 27 2020, 9:57 AM

do you have multiple bindings for lid close in acpi bindings?

It does not look like it, there is only one Lid close ACPI binding. There is a sleep button as well. I do not recall adding either of those, I assume they are defaults. My desktop has the same settings, so I assume they are the defaults.

what have you done to have it suspend on lid close even with ac on?

Nothing that I am aware of, just running with defaults.

in blanking enabled "suspend even on c" (i know bad place for this checkbox... as above - whole thing needs a redo).

In screen blank settings, neither "Suspend on blank" or "Suspend even if AC is checked/enabled.

it's almost as if you have 2 acpi lid close bindings?

I have no idea where the 2nd might be, if that is the case.

i did exactly what you describe above without issues - i could get it to suspend when on ac by checking the checkbox above. check your acpi bindings as you definitely get the acpi events i''d expect.

It suspends on AC for me sometimes, and sometimes when not plugged into AC. The only times it does not suspend, either plugged into AC or not, I get that popup message. I have never seen that popup till 0.24.0. Before that, anytime I closed the lid it would suspend on battery or plugged into AC. I haven't changed any E settings from 0.23 to 0.24.

so just for detail. we have 2 sleep bindings out of the box. 1 is an explicit sleep acpi event:

I do not have any of those in the theme I am using. I assume, I should add those things to the theme.

does your laptop somehow produce both a lid event AND some kind of explicit "sleep" keypress? there doesn't seem to be an acpi event for it in your log above...

Not that I am aware of.

do you have maybe something like "suspend when below" and like 5% or something in the battery gadget settings? (again - yes. a mess. thus the above cleanup)?

Yes, I do have the battery gadget setting set to suspend when below 21%. But it does not seem to have any lid settings. I rarely have my battery that low to trigger that event, but it does happen on occasion and suspends without issue.

can you hunt round for any setting that may be causing it to try suspend and disable/remove them to try identify if multiple are being triggered? so by elimination?

I am unsure where else to look. Other than the setting in screen setup. There is a "Laptop Lid" and also "Lid Events", both those are checked. I believe, I have tried to toggle them to disabled. I can try again.

what would explain your experience would be a laptop that somehow is producing a "sleep key pressed" whenever lid is closed as some kind of hack/workaround no normal lid management. i do not see that on my laptops. they behave "normally" and don't try and second-guess the OS. just wondering if it's this and this would explain the multiple system actions etc. ... and getting stuck in this state is the "untested error path" that you just shouldn't be getting into to begin with... :) but i need to understand what is going on with your system there to know what to possibly do...

No clue, but it all started with 0.24. I never had issues before that, nor did I ever get or see that popup.

I just unplugged from power with my laptop lid closed. Now the screen blanking every few seconds. Soon as I stop typing, or I stop moving the mouse, the screen tries to blank. There is also something weird going on, with my laptop lid closed, the screen is still active, I can move my mouse over there. But when I open the lid, both screens blank and come back, even though nothing is changing.

I do not have any of those in the theme I am using. I assume, I should add those things to the theme.

they are not in the theme - they are in the standard config profile src - so look in the gui settings for acpi and key bindings for anything that smells sleep/hibernate related and delete those OTHER than lid event - keep that.

> does your laptop somehow produce both a lid event AND some kind of explicit "sleep" keypress? there doesn't seem to be an acpi event for it in your log above...
Not that I am aware of.

well i'm now trying s theory that it does - or perhaps the battery below ... or ... wait.. does it produce multiple lid events when you close it? like ssh in and run acpi_listen and do you see just one LID event or more than on when all you do is close the lid?

Yes, I do have the battery gadget setting set to suspend when below 21%. But it does not seem to have any lid settings. I rarely have my battery that low to trigger that event, but it does happen on occasion and suspends without issue.

can you set that to 0% - it just may be that somehow on ac plug/unplug some hiccup happens and for a brief bit the battery thinks you are at some low percentage? i'm trying to eliminate the possible cause

can you try delete / disable all but one specific path for suspending for now and let's stry figure out what could be causing it... it didn't look like you had multiple lid events... but i have no timestamps to be sure.

I do not have any of those in the theme I am using. I assume, I should add those things to the theme.

they are not in the theme - they are in the standard config profile src - so look in the gui settings for acpi and key bindings for anything that smells sleep/hibernate related and delete those OTHER than lid event - keep that.

Ah ok, I only have "Sleep Button" and "Lid Closed" that are associated with suspend. Hibernate has nothing associated. I guess, I should delete the "Sleep Button" one.

> does your laptop somehow produce both a lid event AND some kind of explicit "sleep" keypress? there doesn't seem to be an acpi event for it in your log above...
Not that I am aware of.

well i'm now trying s theory that it does - or perhaps the battery below ... or ... wait.. does it produce multiple lid events when you close it? like ssh in and run acpi_listen and do you see just one LID event or more than on when all you do is close the lid?

No it does not produce multiple lid events per acpi_listen. I was ssh'd in before when I produced the previous output from acpi_listen. Here it is again, anew. I had it closed from a reboot, so I could use the external display without issues. When I opened and closed it again it suspended. I am running on battery. The video/tabletmode is new from the previous acpi_listen session.

# acpi_listen
button/lid LID open
video/tabletmode TBLT 0000008A 00000000
button/lid LID close
button/lid LID open
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
processor LNXCPU:02 00000081 00000000
processor LNXCPU:03 00000081 00000000

Yes, I do have the battery gadget setting set to suspend when below 21%. But it does not seem to have any lid settings. I rarely have my battery that low to trigger that event, but it does happen on occasion and suspends without issue.

can you set that to 0% - it just may be that somehow on ac plug/unplug some hiccup happens and for a brief bit the battery thinks you are at some low percentage? i'm trying to eliminate the possible cause

Ok, I can try that. It is set to 0% now. I plugged into power and I closed the lid and I got the popup again. I opened the lid, got another popup. Then, I unplugged from power, closed and opened the lid, and got the popup each time. It is not suspending now. But with lid closed, the laptop display is still on in all cases. It does not seem to be turning off due to it being extended vs cloned. Cloned is where it had the sizing issues in the initial post. The only time the laptop display is off, is when I boot with it closed and external display connected.

can you try delete / disable all but one specific path for suspending for now and let's stry figure out what could be causing it... it didn't look like you had multiple lid events... but i have no timestamps to be sure.

Here is additional output, I do not believe there are multiple lid events.

battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000001
battery PNP0C0A:00 00000080 00000001
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
processor LNXCPU:02 00000081 00000000
processor LNXCPU:03 00000081 00000000
button/lid LID close
button/lid LID open
ac_adapter ACPI0003:00 00000080 00000000
battery PNP0C0A:00 00000080 00000001
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
processor LNXCPU:02 00000081 00000000
processor LNXCPU:03 00000081 00000000
button/lid LID close
button/lid LID open
button/lid LID close

oooooh... i got a lead from someone else.... let me guess... your system doesn't use systemd?

wltjr added a comment.May 29 2020, 8:03 AM

That is correct, I am sorry for omitting such an important detail. I do not use systemd, I use openrc instead.

very important... because that was the issue... i fixed it in git master
i have cherry-picked for the 0.24 stable branch for the next stable release update
try it

I am sorry about omitting that, but thank you for your time and the fix! I will try it out ASAP!

That fix has eliminated that popup that prevents all system actions and VT switching. However, I am still unable to close my laptop lid with external monitor connected without it suspending. The only way I have found to reliably have my laptop lid closed and only the external display, is to boot or start E with my laptop lid closed.

I have tried plugging in external monitor with lid closed and laptop suspended. Then, pressing the button to wake/unsuspend the laptop with lid closed. That sort of works, but the laptop display stays active; I can move my mouse or windows to that screen. That is the same thing that happens if I turn off a display in the settings, uncheck on. It does turn off the display, but it remains active.

It is progress, the biggest issue has been resolved. Now, if I can only close my laptop lid with external monitor and have it not suspend, that would be great. Thank you again!

can you double-check that the acpi binding for lid event is "suspend intelligently" ? is your screen cloned or extended to left/right etc. ?

wltjr added a comment.May 30 2020, 4:08 PM

Thank you for mentioning the "suspend intelligently"; lid closed was set to "suspend". I just switched it to "suspend intelligently", and I can close the laptop lid with external display connected without it suspending. However, the screen remains active, despite being off. I can move the mouse and windows to that screen.

Also, when I do not have an external display connected, the laptop no longer suspends on lid close when plugged into AC, after the switch to "suspend intelligently". If I unplug from AC and close the lid, the laptop does suspend. That is likely ok, although ideally, it would suspend when lid was closed anytime an external display is not connected, regardless if it is plugged into AC or not.

I have the extended screen set to extend to the left of my laptop display.

what is the name of the laptop screen output? like eDP0 or LVDS0 or something? in screen setup for your laptop lid screen is "laptop lid" checked? (it's not a setting you change - it's something e detects). you can just run xrandr on the cmdline to list output names like LVDS0/1/2, eDP0/2/3, DP0/1/2, HDMI-0, etc. etc.

as for the "if on ac it doesn't suspend": settings -> screen -> blanking -> suspend even if AC ... enable this. the "don't suspend on ac" i0s intentional with suspend intelligently.

wltjr added a comment.Jun 2 2020, 2:59 PM

what is the name of the laptop screen output?

The laptop screen is eDP1.

in screen setup for your laptop lid screen is "laptop lid" checked? (it's not a setting you change - it's something e detects).

Yes that is checked.

as for the "if on ac it doesn't suspend": settings -> screen -> blanking -> suspend even if AC ... enable this. the "don't suspend on ac" i0s intentional with suspend intelligently.

Ok, so, I should have "Suspend even if AC" when I am also using "suspend intelligently". I will give that a go. Right now I have to keep switching back to regular "suspend" from "suspend intelligently" when not plugged into AC. Otherwise, it never suspends when not plugged into AC.

raster added a comment.Jun 2 2020, 3:19 PM

Ok, so, I should have "Suspend even if AC" when I am also using "suspend intelligently"

If you want it to suspend when no external screens are plugged in and the lid is closed and it's plugged into Ac... yes.

wltjr added a comment.Jun 4 2020, 10:13 AM

Ok, after making those changes to settings, it seems most things are functioning as intended. I can close my laptop lid with external display when plugged into AC without it suspending. I can close the laptop lid without external display when running on battery and it will suspend. Only two issues remain.

  1. When I close the laptop lid when plugged into AC, the laptop display is turned off but remains active. I can still move the mouse and cursor there. The only way I have found to get around that is, to reboot/boot the laptop with external display connected and the laptop lid closed.
  1. I am still seeing the non-stop fade out/in of the display in between key press or mouse movement. It is constantly trying to turn off the display. This happens at times when no external display is plugged in, and other times when an external display is connected. It seems related to power. Just now, I triggered it by plugging in an external display, closing laptop lid, and then unplugging from AC. Now, now matter if I have AC plugged in or running on battery, it keeps trying to turn off the display anytime I stop typing or do not move the mouse. I will have to restart E to get it to stop.

Those are the only two remaining issues related to hotplug of display.

raster added a comment.Jun 7 2020, 1:09 PM

if you screenshot while the lid is closed and the mouse goes there - does the shot cover all screens? is one all black? or have content?

you seem to have something odd on your system and i don't know what. i have never seen that kind kinf of behavior on any of my laptops - it's as if the laptop keeps either sending screen plug/unplug events from x (xrandr) or acpi lid events from acpi when in #2 state.

wltjr added a comment.Jun 12 2020, 8:52 AM

if you screenshot while the lid is closed and the mouse goes there - does the shot cover all screens? is one all black? or have content?

Interestingly enough, if I do a screenshot, it only has the one active display. The one that is off does not appear at all. If I take a window shot of a window that is partly on both displays, it only shows the active display, the window is cut in half. The display is off, but I can still move the cursor and windows to that display.

you seem to have something odd on your system and i don't know what. i have never seen that kind kinf of behavior on any of my laptops - it's as if the laptop keeps either sending screen plug/unplug events from x (xrandr) or acpi lid events from acpi when in #2 state.

It is definitely odd, and I often tend to run into a lot of odd and unique problems. I checked for acpi events when the laptop was in its non-stop blanking mode. I do not have a consistent trigger for that. It usually happens when I unplug from external display and power, but sometimes it happens when I am connected to both, right after plugging in power and external display. It is extremely inconsistent. If you have any suggestions as to further diagnose the source or trigger next it occurs, that would be great, and no worries if not.

Thus far, my solution to both is to restart E via the main menu.

hmm this is odd. what if you use import -window root out.png ? does it get both?

sometimes these issues require time and eventually noticing a pattern somewhere and being able to trigger the pattern then following the bredcrumbs... but if your laptop does "weird things" its really hard to code for them without knowing what they are ... :) and given i can't reproduce them i probably need even more details so i can think my way through what the problem would be as i can't test it and poke it and see how it wobbles.

wltjr added a comment.Jun 14 2020, 1:20 PM

hmm this is odd. what if you use import -window root out.png ? does it get both?

Actually, yes, it does get both.

sometimes these issues require time and eventually noticing a pattern somewhere and being able to trigger the pattern then following the bredcrumbs... but if your laptop does "weird things" its really hard to code for them without knowing what they are ... :) and given i can't reproduce them i probably need even more details so i can think my way through what the problem would be as i can't test it and poke it and see how it wobbles.

I complete understand. I am trying to find a pattern to the constantly putting the monitor to sleep issue. That happens inconsistently and not all the time, and I have yet to find any pattern or triggers. That will likely take some time to track down.

The laptop display remaining active with laptop lid closed happens all the time.

I understand you need to be able to replicate to debug. I wish, I could provide further insight to help, at least on the going to sleep issue. Hopefully, we can make progress on the laptop display when lid closed issue, without you being able to replicate. I wonder if there is some other setting causing that, like the other settings I changed per your suggestions. Maybe it is a setting issue.

I also have another issue where E on my laptop locks up a lot. It is odd, as I cannot restart E, even via killing the processes causing a restart, which used to work on occasion in the past. It does not lock up the system, just X. That never happens on my desktop, same binaries. Prior to E 0.24.0, I used to have a lot of crashes. Now that is not happening, but it is just locking up. I need to file a new issue for that, but since I have little information to provide others for debug. There is not much point in filing an issue that cannot be resolved.

My laptop does definitely have some unique issues, as do I... :)

wltjr added a comment.Jun 15 2020, 6:16 PM

Lockup issues were from linux kernel versions, 5.4 and 5.5, that have issues with i915 drivers. Nothing E related, thankfully!

Actually, yes, it does get both.

huh... so it's there... well visually and configured. if you drag windows there they are visible in the import shot? so ... e thinks the screen isn't there and e thinks it probably disabled it. but it isn't disabled. if the mouse pointer goes there ... e isn't adding the pointer barriers in to stop it so e's randr does kind of think it's there... so this is an odd zombie state and i have no idea how you got there...

as for setting - one eay is to rm -rf ~/.e and start from clean and see... ?

wltjr added a comment.EditedJun 17 2020, 9:51 AM

huh... so it's there... well visually and configured. if you drag windows there they are visible in the import shot?

Yes, any windows put there are visible in the shot.

so this is an odd zombie state and i have no idea how you got there...

It happens anytime I close the laptop lid. The external display fades out and back in, but laptop display remains active, but shows off, "On" not checked, in the display settings. The exact same thing happens if I turn off the display in display settings without closing the laptop lid. I just uncheck the "On" checkbox, both displays fade out, the external fades back and laptop display is blank. Yet, I can still move windows and the mouse there. Maybe you can replicate it by unchecking the "On" checkbox in settings.

as for setting - one eay is to rm -rf ~/.e and start from clean and see... ?

I can try that at some point. Although, I was thinking more along the lines of conflicting power settings, like we had with the "Suspend even if AC" and "suspend intelligently". But since it happens with the "On" checkbox, it may not be settings related at all.