emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] volatile fields of struct frame


From: Eli Zaretskii
Subject: Re: [RFC] volatile fields of struct frame
Date: Thu, 27 Dec 2012 19:59:22 +0200

> Date: Wed, 26 Dec 2012 16:18:59 +0400
> From: Dmitry Antipov <address@hidden>
> CC: Eli Zaretskii <address@hidden>, Jan Djärv
>  <address@hidden>
> 
> Since async input is gone, should we try to unify async_visible and
> async_iconified fields of struct frame with their regular counterparts?

Yes.

> === modified file 'src/xterm.c'
> --- src/xterm.c       2012-12-12 15:33:30 +0000
> +++ src/xterm.c       2012-12-26 11:54:17 +0000
> @@ -6106,10 +6106,9 @@
>              /* Gnome shell does not iconify us when C-z is pressed.  It hides
>                 the frame.  So if our state says we aren't hidden anymore,
>                 treat it as deiconified.  */
> -            if (! f->async_iconified)
> +            if (!frame_set_iconified (f, 0))

The old code was only testing the flag, the new one also resets it to
zero.  Is that correct?

> @@ -6233,17 +6230,14 @@
>            /* While a frame is unmapped, display generation is
>               disabled; you don't want to spend time updating a
>               display that won't ever be seen.  */
> -          f->async_visible = 0;
>            /* We can't distinguish, from the event, whether the window
>               has become iconified or invisible.  So assume, if it
>               was previously visible, than now it is iconified.
>               But x_make_frame_invisible clears both
>               the visible flag and the iconified flag;
>               and that way, we know the window is not iconified now.  */
> -          if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
> +          if (frame_set_visible (f, 0) || frame_set_iconified (f, 1))
>              {
> -              f->async_iconified = 1;
> -

Same here.

> -          f->async_visible = 1;
> -          f->async_iconified = 0;
> +       frame_set_visible (f, 1);

The old code was setting only the async_visible flag; why do we need
to set the visible flag instead? why not just remove these 2 lines?

> -          if (f->iconified)
> +          if (frame_set_iconified (f, 0))

Again, you reset where the old code only tested the flag.

> @@ -9305,9 +9293,8 @@
>    if (!result)
>      error ("Can't notify window manager of iconification");
>  
> -  f->async_iconified = 1;
> -  f->async_visible = 0;
> -
> +  frame_set_visible (f, 0);
> +  frame_set_iconified (f, 1);

Why not remove those 2 lines without replacing them?

> @@ -9356,8 +9343,8 @@
>        XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
>      }
>  
> -  f->async_iconified = 1;
> -  f->async_visible = 0;
> +  frame_set_visible (f, 0);
> +  frame_set_iconified (f, 1);

Same question here.

> Here is what I'm now trying for X; comments around NS and W32 stuff
> are highly appreciated.

Any reason why NS or w32 stuff shouldn't get the same changes?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]