Follow the netwm spec and use UTF8 string encoding. Avoid non-portable Xlib

functions too.


SVN revision: 7547
This commit is contained in:
rbdpngn 2003-10-12 05:34:47 +00:00 committed by rbdpngn
parent e2fe7241a1
commit 0969d64850
3 changed files with 12 additions and 5 deletions

View File

@ -50,6 +50,8 @@ Atom _ecore_x_atom_net_wm_pid = 0;
Atom _ecore_x_atom_net_wm_handle_icons = 0;
Atom _ecore_x_atom_net_wm_user_time = 0;
Atom _ecore_x_atom_utf8_string = 0;
Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM] = {0};
int ECORE_X_EVENT_KEY_DOWN = 0;
@ -261,6 +263,8 @@ ecore_x_init(const char *name)
_ecore_x_atom_net_wm_pid = XInternAtom(_ecore_x_disp, "_NET_WM_PID", False);
_ecore_x_atom_net_wm_user_time = XInternAtom(_ecore_x_disp, "_NET_WM_USER_TIME", False);
_ecore_x_atom_utf8_string = XInternAtom(_ecore_x_disp, "UTF8_STRING", False);
_ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_DELETE_REQUEST] = _ecore_x_atom_wm_delete_window;
_ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_TAKE_FOCUS] = _ecore_x_atom_wm_take_focus;

View File

@ -81,6 +81,8 @@ extern Atom _ecore_x_atom_net_wm_user_time;
extern Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
extern Atom _ecore_x_atom_utf8_string;
void _ecore_x_error_handler_init(void);
void _ecore_x_event_handle_key_press(XEvent *xevent);
void _ecore_x_event_handle_key_release(XEvent *xevent);

View File

@ -101,7 +101,7 @@ ecore_x_window_prop_string_set(Ecore_X_Window win, Ecore_X_Atom type, char *str)
if (win == 0) win = DefaultRootWindow(_ecore_x_disp);
xtp.value = str;
xtp.format = 8;
xtp.encoding = XA_STRING;
xtp.encoding = _ecore_x_atom_utf8_string;
xtp.nitems = strlen(str);
XSetTextProperty(_ecore_x_disp, win, &xtp, type);
}
@ -129,7 +129,7 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
if (xtp.format == 8)
{
s = Xutf8TextPropertyToTextList(_ecore_x_disp, &xtp, &list, &items);
s = XmbTextPropertyToTextList(_ecore_x_disp, &xtp, &list, &items);
if ((s == Success) && (items > 0))
{
str = strdup(*list);
@ -156,8 +156,8 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
void
ecore_x_window_prop_title_set(Ecore_X_Window win, const char *t)
{
ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_name, t);
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_name, t);
ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_name, (char *)t);
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_name, (char *)t);
}
/**
@ -189,7 +189,8 @@ ecore_x_window_prop_title_get(Ecore_X_Window win)
void
ecore_x_window_prop_visible_title_set(Ecore_X_Window win, const char *t)
{
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_visible_name, t);
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_visible_name,
(char *)t);
}
/**