Currently I am in charge of developing a (C++) window class for a little project; the goal is to keep dependencies at a bare minimum. The implementation for Win32/WinAPI works as supposed, however, I am struggling when it comes to Linux/XCB.
I am aware, that I am able to check the "_NET_WM_STATE" property, however, the documentation doesn't specify any event, which would occur when the window is being maximized or minimized. The Extended Window Manager Hints specification doesn't seem to define a event either.
So, how would one intercept the Maximize/Minimize event?
EDIT: My code looks basically like that, but doesn't work: (By doesn't work, I mean the if-condition below is never met.)
// xcb_generic_event_t* msg;
// xcb_intern_atom_reply_t* wmStateMinimized;
case XCB_PROPERTY_NOTIFY: {
xcb_property_notify_event_t* data{reinterpret_cast<xcb_property_notify_event_t*>(msg)};
if(data->atom == wmStateMinimized->atom)
eventQueue.emplace(Event::Minimized);
} break;
I have also checked the atoms the event provides me. They differ from the atom provided by 'wmStateMinimized', altough the atom for 'wmStateMinimized' is provided by the window manager.
EDIT 2: Ok, the xcb_property_notify_event_t supplies the atom that has been change, not the value it self. So the if should look like this then:
if(data->atom == wmState->atom)
Gotta figure out, how to retrieve the value properly.