It was quite difficult to look up for Windows, and X11 has its own more complicated way of doing things. On X11, I’ve managed to enter fullscreen, but exiting is even more difficult and less documented.

I know Wayland exists, but as long as XWayland provides a good enough support, I’ll use that instead for now, due to lack of time on my own side.

EDIT: To clarify: I meant how do I do it via API calls, in programming, not by what key is the default (which is F11).

  • wildbus8979@sh.itjust.works
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    2 months ago

    F11 is the default in most cases to enter and exit full screen. Same as Windows I think (I wouldn’t know for sure, never really used it).

    • ZILtoid1991@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      6
      ·
      edit-2
      2 months ago

      Thanks, but that’s not what I’ve wanted the help for.

      EDIT: Why all the downvotes?

      • wildbus8979@sh.itjust.works
        link
        fedilink
        arrow-up
        10
        ·
        2 months ago

        You’ll have to be more specific then, cause that is the most common way to change a window to full screen and back on Linux. Wayland or X11.

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    2 months ago

    To clarify: I meant how do I do it via API calls,

    If you mean at the X11 call level, I think that it’s a window hint, assuming that you’re talking about a borderless fullscreen window, and not true fullscreen (like, DGA or DGA2 or something, in which case you don’t have a fullscreen X11 window, but rather direct access to video memory).

    https://specifications.freedesktop.org/wm-spec/latest/ar01s05.html

    See _NET_WM_STATE_FULLSCREEN, ATOM

    If you’re using a widget toolkit like gtk or something and writing the program, it’ll probably have some higher-level fullscreen toggle function that’ll flip that on X11. Ditto for SDL.

    If you mean in a script or something, I’d maybe try looking at xprop(1) to set that hint.

    I’d also add, on the “user” front, that I don’t use F11 and I think that that every window manager or desktop environment that I’ve ever used provides some way to set a user-specified keystroke to toggle a window’s fullscreen state. I’ve set Windows-Enter to do that for decades, on every environment I’ve used.