- ICCCM says: > If a base size is not provided, the minimum size is to be used in its place and vice versa. i3 didn't obey the "vice versa" part. Min size and base size are both saved without replacements in window_update_normal_hints, floating_check_size makes the needed replacements if either was not provided. - Aspect ratio is now saved correctly in manage_window because window_update_normal_hints is called. - i3 didn't save the aspect ratio if the window conformed the given aspect ratio range when handle_normal_hints was called. If the window was resized to a size outside of the given bounds, i3 didn't correct it. - Aspect ratio now affects only tiling windows, like the rest of the normal size hints - The aspect ratio calculation is now done without a loop A real life example of how these changes affect the workflow: An mpv window, when playing a video, sets its min == max aspect ratio during mapping. i3 ignored these hints. When resized, the window's aspect ratio was not preserved. With this commit, resizing floating mpv windows will always preserve the aspect ratio.
98 lines
2.7 KiB
C
98 lines
2.7 KiB
C
/*
|
|
* vim:ts=4:sw=4:expandtab
|
|
*
|
|
* i3 - an improved dynamic tiling window manager
|
|
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
|
*
|
|
* window.c: Updates window attributes (X11 hints/properties).
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#include <config.h>
|
|
|
|
/**
|
|
* Frees an i3Window and all its members.
|
|
*
|
|
*/
|
|
void window_free(i3Window *win);
|
|
|
|
/**
|
|
* Updates the WM_CLASS (consisting of the class and instance) for the
|
|
* given window.
|
|
*
|
|
*/
|
|
void window_update_class(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt);
|
|
|
|
/**
|
|
* Updates the name by using _NET_WM_NAME (encoded in UTF-8) for the given
|
|
* window. Further updates using window_update_name_legacy will be ignored.
|
|
*
|
|
*/
|
|
void window_update_name(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt);
|
|
|
|
/**
|
|
* Updates the name by using WM_NAME (encoded in COMPOUND_TEXT). We do not
|
|
* touch what the client sends us but pass it to xcb_image_text_8. To get
|
|
* proper unicode rendering, the application has to use _NET_WM_NAME (see
|
|
* window_update_name()).
|
|
*
|
|
*/
|
|
void window_update_name_legacy(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt);
|
|
|
|
/**
|
|
* Updates the CLIENT_LEADER (logical parent window).
|
|
*
|
|
*/
|
|
void window_update_leader(i3Window *win, xcb_get_property_reply_t *prop);
|
|
|
|
/**
|
|
* Updates the TRANSIENT_FOR (logical parent window).
|
|
*
|
|
*/
|
|
void window_update_transient_for(i3Window *win, xcb_get_property_reply_t *prop);
|
|
|
|
/**
|
|
* Updates the _NET_WM_STRUT_PARTIAL (reserved pixels at the screen edges)
|
|
*
|
|
*/
|
|
void window_update_strut_partial(i3Window *win, xcb_get_property_reply_t *prop);
|
|
|
|
/**
|
|
* Updates the WM_WINDOW_ROLE
|
|
*
|
|
*/
|
|
void window_update_role(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt);
|
|
|
|
/**
|
|
* Updates the _NET_WM_WINDOW_TYPE property.
|
|
*
|
|
*/
|
|
void window_update_type(i3Window *window, xcb_get_property_reply_t *reply);
|
|
|
|
/**
|
|
* Updates the WM_NORMAL_HINTS
|
|
*
|
|
*/
|
|
bool window_update_normal_hints(i3Window *win, xcb_get_property_reply_t *reply, xcb_get_geometry_reply_t *geom);
|
|
|
|
/**
|
|
* Updates the WM_HINTS (we only care about the input focus handling part).
|
|
*
|
|
*/
|
|
void window_update_hints(i3Window *win, xcb_get_property_reply_t *prop, bool *urgency_hint);
|
|
|
|
/**
|
|
* Updates the MOTIF_WM_HINTS. The container's border style should be set to
|
|
* `motif_border_style' if border style is not BS_NORMAL.
|
|
*
|
|
* i3 only uses this hint when it specifies a window should have no
|
|
* title bar, or no decorations at all, which is how most window managers
|
|
* handle it.
|
|
*
|
|
* The EWMH spec intended to replace Motif hints with _NET_WM_WINDOW_TYPE, but
|
|
* it is still in use by popular widget toolkits such as GTK+ and Java AWT.
|
|
*
|
|
*/
|
|
void window_update_motif_hints(i3Window *win, xcb_get_property_reply_t *prop, border_style_t *motif_border_style);
|