Documentation inconsistency/issue

Hi, ALL,
In the this it is stated:

And in the documentation for GtkWidget-window-state-event nothing is mentioned about fullscreen state.
I presume it is about GdkEventWindowState event pointer that I can track the state of the window.

However, looking at this I presume I shuold look at the first parameter, which is GdkEventType. But trying it I don’t see anything related to full screen. Checking changed_mask parameter I see the mask for full screen, but it just a mask.

So can someone elaborate on the validity of the note in the first link?
How can I track the full screen window state with that event?

Thank you in advance.

In GdkEventWindowState, changed_mask will tell you if the window-state-event signal is triggered by a fullscreen state change; new_window_state contains the actual fullscreen state.

The GtkWidget::window-state-event signal gives you a GdkEventWindowState event structure, which contains the mask of the state that changed, as well as the new state of the window.

A typical signal handler is similar to this:

static gboolean
on_window_state_event (GtkWidget *widget, GdkEventWindowState *event)
{
  gboolean is_maximized =
    (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
  gboolean is_fullscreen =
    (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;

  // do something with is_maximized and is_fullscreen

  // continue the event propagation
  return GDK_EVENT_PROPAGATE;
}

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.