Skip to main content
GameDev.net gamedev.net
🔒 Locked

Adjusting window sizes in X11

Started by incertia Feb 15, 2017 at 7:50 PM 3 replies 2.9k views
Original Post
incertia
incertia

Under Windows platforms, we have access to AdjustWindowRectEx to make sure that the client area has the desired size. Due to the diversity of window managers available on Linux systems, is there a way to have X11 ask the current window manager what the correct properties should be to get the desired client area, or should we wait for the first expose event to determine the correct settings?

On a related note, is there a way to impose window size restrictions in X11? Or is it up to the window manager to honor the WM_NORMAL_HINTS property?

what
frob
frob



is there a way to have X11 ask the current window manager what the correct properties should be to get the desired client area

XCreateWindow() and XResizeWindow() and related functions use width and height values for the client area. They already are the internal window sizes. Any frames from the window manager are in addition to the values specified as width and height.

incertia
incertia

Hmm, so if a window manager desides to grow a border internally, that should be a bug? My current issue is with XMonad, where I have configured it to give floating windows a border width of two pixels, and the client area shrinks to make room for the border.

what
frob
frob

Check the manual for your system. Not sure what you're using, but it appears the many online manuals mention it the same: Specify the width and height, which are the created window's inside dimensions and do not include the created window's borders.

incertia
incertia

Okay so it looks like a window manager issue. Launching X without a window manager creates the borders on the outside.

what

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.