bendikMichal / pyretro-gui

PyRetro-Gui (also pyretrogui) is a gui framework built using pygame-ce to develop nostalgic looking apps.
MIT License
59 stars 2 forks source link

_NET_WM_STATE_MAXIMIZED instead of _NET_WM_WORK_AREA #6

Closed Clutchnp closed 1 month ago

Clutchnp commented 1 month ago

_NET_WM_STATE is more popularly implemented than _NET_WM_WORK_AREA

bendikMichal commented 1 month ago

Can not really test it right now, but I'd put the maximizing into a separate function, as it seems long enough with a purpose of maximizing.

Clutchnp commented 1 month ago

you mean making a separate function for linux maximizing like this ?

else:
  def linux_maximize():
         ds, root = x_maximize()
        window_id = pygame.display.get_wm_info()['window']
        wm_state = ds.intern_atom('_NET_WM_STATE')
        max_horz = ds.intern_atom('_NET_WM_STATE_MAXIMIZED_HORZ')
        max_vert = ds.intern_atom('_NET_WM_STATE_MAXIMIZED_VERT')

        data = [1, max_horz, max_vert,0,0]
        e = event.ClientMessage(
                window=window_id,
                client_type=wm_state,
                format=32,
                data=(32, data)
            )
        root.send_event(e, event_mask=X.SubstructureRedirectMask | X.SubstructureNotifyMask)
        ds.flush()
   linux_maximize()
bendikMichal commented 1 month ago

Yes, that's what I meant, putting it into retro_screen.py would be also quite reasonable in my opinion.

Clutchnp commented 1 month ago

done

bendikMichal commented 1 month ago

Thanks, will get to testing it around the weekend.

bendikMichal commented 1 month ago

Alright seem to work fine, also we should hide the maximize button, when minimize is not supported but lets leave that for another pr. As always thanks for contributing.