![]() Registered Member ![]()
|
i ended up creating a hook for pm-utils. i called it 00togglecompositing and put it in /etc/pm/sleep.d.
but for some reason, i get these errors:
and
|
![]() Administrator ![]()
|
You need to set DISPLAY to ":0"
additionally, I would recommend sourcing ~/.dbus/session-bus/* as the user, not as root, for both security and multiple user support.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
can you elaborate? i just copied the code from the arch wiki: http://wiki.archlinux.org/index.php/Pm- ... re_suspend how do i set it? what does that command do?
can you explain what you mean here as well? i was doing some more research, and it seems an alternative approach would be to write a script that accomplishes the same task and link it to powerdevil. this is easier than creating a hook for pm-utils in the sense that pm-utils is outside of x. what do you think of the alternative approach? is it possible to implement? |
![]() Administrator ![]()
|
Add the following scripts:
~/.local/prepare-suspend.sh
~/.local/resume-suspend.sh
Change 00togglecompositing to:
In your script, if KWin had managed to access the display, then it would have started and KWin would have been running as root which is EXTREMELY dangerous.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
thank you, bcooksley!
note: there are two minor errors in the first script. first, the quotation mark before 'qdbus' should be a left quotation mark '`'. second, a semicolon is needed before the 'then'. the fixed script:
seems to work. also, the second script is problematic on occasion; either the screen goes black when compositing is enabled or everything comes back properly, but some windows are missing borders, etc. to get around this problem, i added 'kwin --replace' after the last line. interestingly, i get the following error in pm-suspend.log:
not sure why. however, thus far, everything appears to be working properly. i'm going to continue testing this, but the solution is promising. |
![]() Registered Member ![]()
|
i removed the 'kwin --replace' command and everything works (moreover, no errors). i haven't had a black screen since. i guess i didn't need it after all.
i'm marking this thread as solved. thank you again, bcooksley. |
![]() Registered Member ![]()
|
sorry to bring this back up, but the fix noted earlier no longer works (at least not consistently).
to get around the problem, i've created a new hook called 00restartkdm with the following code:
is there anything wrong with this workaround? |
![]() Administrator ![]()
|
As far as I am aware, there shouldn't be, assuming it works fine for you with no ill effects ( such as being thrown back to the login screen )
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
thanks, bcooksley.
i get the splash screen upon resume, which is expected. i just want to make sure that there are no issues with security or data integrity associated with the workaround. is there a better way to restart the graphics (x server)? edit: i noticed this in pm-suspend.log:
but kdm (and my desktop) starts properly. |
![]() Administrator ![]()
|
There is no issue associated with security, however if it succeeds ( which it seems to not ) then you will likely end up back at the login screen. I do not know of any method to restart the X server as such. Changing to a virtual terminal, then back to X is common to trigger the display to be reconfigured.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
i tried switching to a virtual terminal and then back to x with this:
but that didn't work. i still ended up with a black screen and a cursor. i guess i'll just use my 00restartkdm hook for now and see how it works out. |
![]() Registered Member ![]()
|
Seems to me that this issue is caused not by the gfx driver but by a bug in KDE's lock screen mechanism.
After resume I can seen the screen saver, and the unlock screen dialog (password entry). After this the screen goes black, revealing only the mouse cursor, clicking around and doing things suggest the system is still running , cursor changes to text entry symbol, dragging reveals a document icon under certain situations etc. As others have noted if an app is open and maximised on suspend the issue does not appear to happen on resume. If no app is open or maximised the problem is apparent. I marked on my screen the position of the battery icon and suspend button so that I could do this blindly when it messed up - upon resuming again the screen comes back correctly, repeat this several times, the resume cycles alternate between correctly drawn screen and black screen with mouse cursor. Running pm-suspend in a tty seems to produce different behavouir, the screen always remains black on resume. I then decided to uncheck the "lock screen on resume" box in the settings, the problem is gone altogether, with the slight problem that the screen is not locked on resume. Hope this helps somebody. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]