[MPlayer-cvslog] r34727 - trunk/libvo/x11_common.c

reimar subversion at mplayerhq.hu
Tue Feb 14 21:23:02 CET 2012


Author: reimar
Date: Tue Feb 14 21:23:02 2012
New Revision: 34727

Log:
Mark window title as UTF-8.
Makes setting a -title with UTF-8 characters work.
Patch by Vladimir Mosgalin [mosgalin {} VM10124 spb edu],
updated by me to latest SVN.

Modified:
   trunk/libvo/x11_common.c

Modified: trunk/libvo/x11_common.c
==============================================================================
--- trunk/libvo/x11_common.c	Tue Feb 14 21:06:43 2012	(r34726)
+++ trunk/libvo/x11_common.c	Tue Feb 14 21:23:02 2012	(r34727)
@@ -115,11 +115,13 @@ static Atom XA_NET_WM_STATE_ABOVE;
 static Atom XA_NET_WM_STATE_STAYS_ON_TOP;
 static Atom XA_NET_WM_STATE_BELOW;
 static Atom XA_NET_WM_PID;
+static Atom XA_NET_WM_NAME;
 static Atom XA_WIN_PROTOCOLS;
 static Atom XA_WIN_LAYER;
 static Atom XA_WIN_HINTS;
 static Atom XAWM_PROTOCOLS;
 static Atom XAWM_DELETE_WINDOW;
+static Atom XAUTF8_STRING;
 
 #define XA_INIT(x) XA##x = XInternAtom(mDisplay, #x, False)
 
@@ -357,11 +359,13 @@ static void init_atoms(void)
     XA_INIT(_NET_WM_STATE_STAYS_ON_TOP);
     XA_INIT(_NET_WM_STATE_BELOW);
     XA_INIT(_NET_WM_PID);
+    XA_INIT(_NET_WM_NAME);
     XA_INIT(_WIN_PROTOCOLS);
     XA_INIT(_WIN_LAYER);
     XA_INIT(_WIN_HINTS);
     XA_INIT(WM_PROTOCOLS);
     XA_INIT(WM_DELETE_WINDOW);
+    XA_INIT(UTF8_STRING);
 }
 
 void update_xinerama_info(void) {
@@ -1132,6 +1136,8 @@ void vo_x11_create_vo_window(XVisualInfo
   if (flags & VOFLAG_HIDDEN)
     goto final;
   XStoreName(mDisplay, vo_window, title);
+  XChangeProperty(mDisplay, vo_window, XA_NET_WM_NAME, XAUTF8_STRING,
+                  8, PropModeReplace, title, strlen(title));
   if (window_state & VOFLAG_HIDDEN) {
     XSizeHints hint;
     XEvent xev;


More information about the MPlayer-cvslog mailing list