xwm: Add icon support to the frame
This fetches the _NET_WM_ICON property of the X11 window, and use the first image found as the frame icon. This has been tested with various X11 programs, and improves usability and user-friendliness a bit. Changes since v1: - Changed frame_button_create() to use frame_button_create_from_surface() internally. - Removed a check that should never have been commited. Changes since v2: - Request UINT32_MAX items instead of 2048, to avoid cutting valid icons. - Strengthen checks against malformed input. - Handle XCB_PROPERTY_DELETE to remove the icon. - Schedule a repaint if the icon changed. Changes since v3: - Keep the previous Cairo surface until the new one has been successfully loaded. - Use uint32_t for cardinals. Unsigned is the same type except on 16-bit machines, but uint32_t is clearer. - Declare length as uint32_t too, like in xcb_get_property_reply_t. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
committed by
Daniel Stone
parent
cb04cc4f68
commit
6b58ea8c43
@@ -869,7 +869,7 @@ wayland_output_set_windowed(struct wayland_output *output)
|
||||
return -1;
|
||||
}
|
||||
output->frame = frame_create(b->theme, 100, 100,
|
||||
FRAME_BUTTON_CLOSE, output->title);
|
||||
FRAME_BUTTON_CLOSE, output->title, NULL);
|
||||
if (!output->frame)
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user