some question with regard to GdkWindowState



Title: some question with regard to GdkWindowState

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?

Thanks
Yong



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