Re: some question with regard to GdkWindowState



On Fri, 2005-09-30 at 15:17 +0800, Wang, Yong Y wrote:
> Thanks Owen for the answer!
> 
> I have some questions about GdkWindowState.
> 
> Functions like gdk_window_iconify/gdk_window_deiconify,
> gdk_window_maximize/gdk_window_unmaximize, etc can all change the
> state of a GdkWindow. From the gdk source code, I saw that all these
> functions have an if statement GDK_WINDOW_IS_MAPPED (window) to
> determine what will happen. Only when the condition fails, the state
> of the window will change. Thus, the following test case cannot pass.
> 
>         ......
> 
>         window = gdk_window_new (NULL, &attributes, GDK_WA_X |
> GDK_WA_Y);
> 
>         gdk_window_show (window);
> 
>         gdk_window_iconify (window);
> 
>         window_state = gdk_window_get_state (window);
> 
>         if (!(window_state & GDK_WINDOW_STATE_ICONIFIED)) 
>                 printf ("window isn't iconified\n");
> 
>         ......
> 
> If the gdk_window_show (window) statement is removed which effectively
> causes GDK_WINDOW_IS_MAPPED (window) to become false, the test case
> can pass.
> 
> If my understanding is correct, does it mean that gdk_window_get_state
> cannot work correctly?

Once a window has been mapped, it's properties are under the control
of the window manager, so you can only make a request and wait for
the window manager to honor it (or possibly not, window managers
aren't required to do so.)

That's why it is gdk_window_iconify(), not gdk_window_set_iconified().

Regards,
					Owen





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