i3
Macros | Functions
window.c File Reference
#include "all.h"
Include dependency graph for window.c:

Go to the source code of this file.

Macros

#define I3__FILE__   "window.c"
 
#define MWM_HINTS_DECORATIONS   (1 << 1)
 
#define MWM_DECOR_ALL   (1 << 0)
 
#define MWM_DECOR_BORDER   (1 << 1)
 
#define MWM_DECOR_TITLE   (1 << 3)
 

Functions

void window_update_class (i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt)
 Updates the WM_CLASS (consisting of the class and instance) for the given window. More...
 
void window_update_name (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. More...
 
void window_update_name_legacy (i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt)
 Updates the name by using WM_NAME (encoded in COMPOUND_TEXT). More...
 
void window_update_leader (i3Window *win, xcb_get_property_reply_t *prop)
 Updates the CLIENT_LEADER (logical parent window). More...
 
void window_update_transient_for (i3Window *win, xcb_get_property_reply_t *prop)
 Updates the TRANSIENT_FOR (logical parent window). More...
 
void window_update_strut_partial (i3Window *win, xcb_get_property_reply_t *prop)
 Updates the _NET_WM_STRUT_PARTIAL (reserved pixels at the screen edges) More...
 
void window_update_role (i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt)
 Updates the WM_WINDOW_ROLE. More...
 
void window_update_hints (i3Window *win, xcb_get_property_reply_t *prop, bool *urgency_hint)
 Updates the WM_HINTS (we only care about the input focus handling part). More...
 
void window_update_motif_hints (i3Window *win, xcb_get_property_reply_t *prop, border_style_t *motif_border_style)
 Updates the MOTIF_WM_HINTS. More...
 

Macro Definition Documentation

#define I3__FILE__   "window.c"

Definition at line 2 of file window.c.

#define MWM_DECOR_ALL   (1 << 0)
#define MWM_DECOR_BORDER   (1 << 1)
#define MWM_DECOR_TITLE   (1 << 3)
#define MWM_HINTS_DECORATIONS   (1 << 1)

Function Documentation

void window_update_class ( i3Window win,
xcb_get_property_reply_t *  prop,
bool  before_mgmt 
)

Updates the WM_CLASS (consisting of the class and instance) for the given window.

Definition at line 19 of file window.c.

References Window::class_class, Window::class_instance, DLOG, FREE, LOG, run_assignments(), and sstrdup().

Referenced by manage_window().

Here is the call graph for this function:

void window_update_hints ( i3Window win,
xcb_get_property_reply_t *  prop,
bool *  urgency_hint 
)

Updates the WM_HINTS (we only care about the input focus handling part).

Definition at line 232 of file window.c.

References DLOG, Window::doesnt_accept_focus, FREE, LOG, xcb_icccm_get_wm_hints_from_reply, xcb_icccm_wm_hints_get_urgency, and xcb_icccm_wm_hints_t.

Referenced by handle_hints(), and manage_window().

void window_update_leader ( i3Window win,
xcb_get_property_reply_t *  prop 
)

Updates the CLIENT_LEADER (logical parent window).

Definition at line 126 of file window.c.

References DLOG, FREE, and Window::leader.

Referenced by handle_clientleader_change(), and manage_window().

void window_update_motif_hints ( i3Window win,
xcb_get_property_reply_t *  prop,
border_style_t motif_border_style 
)

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.

Definition at line 271 of file window.c.

References BS_NONE, BS_NORMAL, BS_PIXEL, FREE, MWM_DECOR_ALL, MWM_DECOR_BORDER, MWM_DECOR_TITLE, and MWM_HINTS_DECORATIONS.

Referenced by manage_window().

void window_update_name ( 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.

Definition at line 57 of file window.c.

References DLOG, FREE, i3string_as_utf8(), i3string_free(), i3string_from_utf8_with_length(), LOG, Window::name, Window::name_x_changed, run_assignments(), and Window::uses_net_wm_name.

Referenced by handle_windowname_change(), and manage_window().

Here is the call graph for this function:

void window_update_name_legacy ( 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()).

Definition at line 89 of file window.c.

References DLOG, FREE, i3string_as_utf8(), i3string_free(), i3string_from_utf8_with_length(), LOG, Window::name, Window::name_x_changed, run_assignments(), and Window::uses_net_wm_name.

Referenced by handle_windowname_change_legacy(), and manage_window().

Here is the call graph for this function:

void window_update_role ( i3Window win,
xcb_get_property_reply_t *  prop,
bool  before_mgmt 
)

Updates the WM_WINDOW_ROLE.

Definition at line 199 of file window.c.

References DLOG, FREE, LOG, Window::role, and run_assignments().

Referenced by handle_windowrole_change(), and manage_window().

Here is the call graph for this function:

void window_update_strut_partial ( i3Window win,
xcb_get_property_reply_t *  prop 
)

Updates the _NET_WM_STRUT_PARTIAL (reserved pixels at the screen edges)

Definition at line 174 of file window.c.

References DLOG, FREE, and Window::reserved.

Referenced by manage_window().

void window_update_transient_for ( i3Window win,
xcb_get_property_reply_t *  prop 
)

Updates the TRANSIENT_FOR (logical parent window).

Definition at line 150 of file window.c.

References DLOG, FREE, Window::transient_for, and xcb_icccm_get_wm_transient_for_from_reply.

Referenced by handle_transient_for(), and manage_window().