unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6719: Issues with Windows hibernation
@ 2010-07-24 16:52 Esa Peuha
  2019-10-01 19:34 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Esa Peuha @ 2010-07-24 16:52 UTC (permalink / raw)
  To: 6719

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

If Windows XP is hibernated while Emacs 23.2 is running, Emacs gets
the <sleep> event which by default is undefined, so Emacs beeps before
hibernation and displays "<sleep> is undefined" after Windows is
resumed; I think <sleep> should be ignored by default. Also, if the
Emacs window was maximized before hibernation, it isn't restored to
quite as it was; its size is reduced slightly and it's surrounded by
the usual window border.

[-- Attachment #2: Type: text/html, Size: 498 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2010-07-24 16:52 bug#6719: Issues with Windows hibernation Esa Peuha
@ 2019-10-01 19:34 ` Lars Ingebrigtsen
  2019-10-02 14:53   ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-01 19:34 UTC (permalink / raw)
  To: Esa Peuha; +Cc: 6719

Esa Peuha <esa.peuha@gmail.com> writes:

> If Windows XP is hibernated while Emacs 23.2 is running, Emacs gets
> the <sleep> event which by default is undefined, so Emacs beeps before
> hibernation and displays "<sleep> is undefined" after Windows is
> resumed; I think <sleep> should be ignored by default.

(I'm going through old bug reports that unfortunately didn't get any
response at the time.)

This seems like a reasonable thing to add to global-map (i.e., ignoring
[sleep]), but is it common for Windows to send a [sleep] keystroke to
apps before hibernating?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-01 19:34 ` Lars Ingebrigtsen
@ 2019-10-02 14:53   ` Eli Zaretskii
  2019-10-03 14:26     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-10-02 14:53 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: esa.peuha, 6719

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 01 Oct 2019 21:34:04 +0200
> Cc: 6719@debbugs.gnu.org
> 
> Esa Peuha <esa.peuha@gmail.com> writes:
> 
> > If Windows XP is hibernated while Emacs 23.2 is running, Emacs gets
> > the <sleep> event which by default is undefined, so Emacs beeps before
> > hibernation and displays "<sleep> is undefined" after Windows is
> > resumed; I think <sleep> should be ignored by default.
> 
> (I'm going through old bug reports that unfortunately didn't get any
> response at the time.)
> 
> This seems like a reasonable thing to add to global-map (i.e., ignoring
> [sleep]), but is it common for Windows to send a [sleep] keystroke to
> apps before hibernating?

I don't know, FWIW, and couldn't see where we any w32 code to inject
that event when the system is about to hibernate.  Maybe I'm missing
something.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-02 14:53   ` Eli Zaretskii
@ 2019-10-03 14:26     ` Lars Ingebrigtsen
  2019-10-03 16:46       ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-03 14:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: esa.peuha, 6719

Eli Zaretskii <eliz@gnu.org> writes:

>> This seems like a reasonable thing to add to global-map (i.e., ignoring
>> [sleep]), but is it common for Windows to send a [sleep] keystroke to
>> apps before hibernating?
>
> I don't know, FWIW, and couldn't see where we any w32 code to inject
> that event when the system is about to hibernate.  Maybe I'm missing
> something.

Is it possible that the OS just sends a [sleep] event to all clients
when it's about to hibernate?  It would be a pretty simple interface for
notifying apps instead of using signals or a message bus...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-03 14:26     ` Lars Ingebrigtsen
@ 2019-10-03 16:46       ` Eli Zaretskii
  2019-10-03 17:12         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-10-03 16:46 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: esa.peuha, 6719

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: esa.peuha@gmail.com,  6719@debbugs.gnu.org
> Date: Thu, 03 Oct 2019 16:26:26 +0200
> 
> > I don't know, FWIW, and couldn't see where we any w32 code to inject
> > that event when the system is about to hibernate.  Maybe I'm missing
> > something.
> 
> Is it possible that the OS just sends a [sleep] event to all clients
> when it's about to hibernate?

Maybe, I just don't know.  AFAIK, the message sent in that case is not
processed by Emacs to generate a 'sleep' function key, we only
generate that when the actual "sleep" key on the keyboard is pressed.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-03 16:46       ` Eli Zaretskii
@ 2019-10-03 17:12         ` Lars Ingebrigtsen
  2019-10-03 17:30           ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-03 17:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: esa.peuha, 6719

Eli Zaretskii <eliz@gnu.org> writes:

> Maybe, I just don't know.  AFAIK, the message sent in that case is not
> processed by Emacs to generate a 'sleep' function key, we only
> generate that when the actual "sleep" key on the keyboard is pressed.

On GNU/Linux, it's easy enough to inject events into the event queue of
a process that's indistinguishable from an actual keyboard event, so I
was assuming that Windows also had such a thing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-03 17:12         ` Lars Ingebrigtsen
@ 2019-10-03 17:30           ` Eli Zaretskii
  2019-10-07  3:30             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-10-03 17:30 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: esa.peuha, 6719

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: esa.peuha@gmail.com,  6719@debbugs.gnu.org
> Date: Thu, 03 Oct 2019 19:12:18 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Maybe, I just don't know.  AFAIK, the message sent in that case is not
> > processed by Emacs to generate a 'sleep' function key, we only
> > generate that when the actual "sleep" key on the keyboard is pressed.
> 
> On GNU/Linux, it's easy enough to inject events into the event queue of
> a process that's indistinguishable from an actual keyboard event, so I
> was assuming that Windows also had such a thing.

It does.  It's just that I don't see that particular message handled
anywhere in our sources which handle various Windows messages, so I
wonder how did the OP get the 'sleep' function key in the first place.
Maybe he just pressed the Sleep key...





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-03 17:30           ` Eli Zaretskii
@ 2019-10-07  3:30             ` Lars Ingebrigtsen
  2019-10-07  5:04               ` Tomas Nordin
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-07  3:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: esa.peuha, 6719

Eli Zaretskii <eliz@gnu.org> writes:

> It does.  It's just that I don't see that particular message handled
> anywhere in our sources which handle various Windows messages, so I
> wonder how did the OP get the 'sleep' function key in the first place.
> Maybe he just pressed the Sleep key...

It's possible.

Does anybody here have access to a Windows laptop that goes to sleep
when you close the lid?  Could you try to do that and see whether Emacs
gets a [sleep] event that it then complains about?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-07  3:30             ` Lars Ingebrigtsen
@ 2019-10-07  5:04               ` Tomas Nordin
  2019-10-07  5:06                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Tomas Nordin @ 2019-10-07  5:04 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Eli Zaretskii; +Cc: esa.peuha, 6719

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> It does.  It's just that I don't see that particular message handled
>> anywhere in our sources which handle various Windows messages, so I
>> wonder how did the OP get the 'sleep' function key in the first place.
>> Maybe he just pressed the Sleep key...
>
> It's possible.
>
> Does anybody here have access to a Windows laptop that goes to sleep
> when you close the lid?  Could you try to do that and see whether Emacs
> gets a [sleep] event that it then complains about?

I do at work, what must I do? What should I inspect when coming back
from sleep?

Best regards
--
Tomas

>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-07  5:04               ` Tomas Nordin
@ 2019-10-07  5:06                 ` Lars Ingebrigtsen
  2019-10-07  8:57                   ` Tomas Nordin
  2019-10-07 12:13                   ` Noam Postavsky
  0 siblings, 2 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-07  5:06 UTC (permalink / raw)
  To: Tomas Nordin; +Cc: esa.peuha, 6719

Tomas Nordin <tomasn@posteo.net> writes:

> I do at work, what must I do? What should I inspect when coming back
> from sleep?

The bug report states that Emacs says

"<sleep> is undefined"

when the lid is opened (and Windows has resumed from sleep).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-07  5:06                 ` Lars Ingebrigtsen
@ 2019-10-07  8:57                   ` Tomas Nordin
  2019-10-08 16:39                     ` Lars Ingebrigtsen
  2019-10-07 12:13                   ` Noam Postavsky
  1 sibling, 1 reply; 13+ messages in thread
From: Tomas Nordin @ 2019-10-07  8:57 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: esa.peuha, 6719

On 07.10.2019 07:06, Lars Ingebrigtsen wrote:
> Tomas Nordin <tomasn@posteo.net> writes:
> 
>> I do at work, what must I do? What should I inspect when coming back
>> from sleep?
> 
> The bug report states that Emacs says
> 
> "<sleep> is undefined"
> 
> when the lid is opened (and Windows has resumed from sleep).

Had my normal Emacs running and started one emacs -Q. Closed the lid for 
a while to go to sleep. When back I
could not see anything about sleep in the instances. I checked the 
messages (`view-echo-area-messages`).

Here is some info from the emacs -Q instance:

In GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
  of 2019-04-13 built on CIRROCUMULUS
Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749
Windowing system distributor 'Microsoft Corp.', version 10.0.17134
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Configured using:
  'configure --without-dbus --host=x86_64-w64-mingw32
  --without-compress-install 'CFLAGS=-O2 -static -g3''






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-07  5:06                 ` Lars Ingebrigtsen
  2019-10-07  8:57                   ` Tomas Nordin
@ 2019-10-07 12:13                   ` Noam Postavsky
  1 sibling, 0 replies; 13+ messages in thread
From: Noam Postavsky @ 2019-10-07 12:13 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Tomas Nordin, esa.peuha, 6719

Lars Ingebrigtsen <larsi@gnus.org> writes:

> The bug report states that Emacs says
>
> "<sleep> is undefined"
>
> when the lid is opened (and Windows has resumed from sleep).

The OP says nothing about a lid.  (And I wouldn't expect opening a lid
to wake up from hibernate, though maybe it's possible to configure
things that way)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6719: Issues with Windows hibernation
  2019-10-07  8:57                   ` Tomas Nordin
@ 2019-10-08 16:39                     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-08 16:39 UTC (permalink / raw)
  To: Tomas Nordin; +Cc: esa.peuha, 6719

Tomas Nordin <tomasn@posteo.net> writes:

> Had my normal Emacs running and started one emacs -Q. Closed the lid
> for a while to go to sleep. When back I
> could not see anything about sleep in the instances. I checked the
> messages (`view-echo-area-messages`).

Thanks for checking.  Since this problem seems unreproducible, perhaps
it was just something Windows did in one particular old version?  So I'm
closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-10-08 16:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-24 16:52 bug#6719: Issues with Windows hibernation Esa Peuha
2019-10-01 19:34 ` Lars Ingebrigtsen
2019-10-02 14:53   ` Eli Zaretskii
2019-10-03 14:26     ` Lars Ingebrigtsen
2019-10-03 16:46       ` Eli Zaretskii
2019-10-03 17:12         ` Lars Ingebrigtsen
2019-10-03 17:30           ` Eli Zaretskii
2019-10-07  3:30             ` Lars Ingebrigtsen
2019-10-07  5:04               ` Tomas Nordin
2019-10-07  5:06                 ` Lars Ingebrigtsen
2019-10-07  8:57                   ` Tomas Nordin
2019-10-08 16:39                     ` Lars Ingebrigtsen
2019-10-07 12:13                   ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).