re-add support for legacy window titles (WM_NAME)

This commit is contained in:
Michael Stapelberg
2010-04-13 17:46:54 +02:00
parent fd8735a6fd
commit dd7acf73e9
8 changed files with 118 additions and 94 deletions

View File

@ -247,11 +247,21 @@ struct xoutput {
struct Window {
xcb_window_t id;
const char *class_class;
const char *class_instance;
const char *name_ucs2;
const char *name_utf8;
char *class_class;
char *class_instance;
/** The name of the window as it will be passod to X11 (in UCS2 if the
* application supports _NET_WM_NAME, in COMPOUND_TEXT otherwise). */
char *name_x;
/** The name of the window as used in JSON (in UTF-8 if the application
* supports _NET_WM_NAME, in COMPOUND_TEXT otherwise) */
char *name_json;
/** The length of the name in glyphs (not bytes) */
int name_len;
/** Whether the application used _NET_WM_NAME */
bool uses_net_wm_name;
};

View File

@ -115,17 +115,9 @@ int handle_destroy_notify_event(void *data, xcb_connection_t *conn,
int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
xcb_window_t window, xcb_atom_t atom,
xcb_get_property_reply_t *prop);
#if 0
/**
* We handle legacy window names (titles) which are in COMPOUND_TEXT
* encoding. However, we just pass them along, so when containing non-ASCII
* characters, those will be rendering incorrectly. In order to correctly
* render unicode window titles in i3, an application has to set _NET_WM_NAME,
* which is in UTF-8 encoding.
*
* On every update, a message is put out to the user, so he may improve the
* situation and update applications which display filenames in their title to
* correctly use _NET_WM_NAME and therefore support unicode.
* Handles legacy window name updates (WM_NAME), see also src/window.c,
* window_update_name_legacy().
*
*/
int handle_windowname_change_legacy(void *data, xcb_connection_t *conn,
@ -133,6 +125,7 @@ int handle_windowname_change_legacy(void *data, xcb_connection_t *conn,
xcb_atom_t atom, xcb_get_property_reply_t
*prop);
#if 0
/**
* Store the window classes for jumping to them later.
*

View File

@ -3,5 +3,6 @@
void window_update_class(i3Window *win, xcb_get_property_reply_t *prop);
void window_update_name(i3Window *win, xcb_get_property_reply_t *prop);
void window_update_name_legacy(i3Window *win, xcb_get_property_reply_t *prop);
#endif