[vlc-devel] commit: Set a name for the video window ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Apr 15 21:06:40 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 15 22:06:01 2009 +0300| [5948f590e8482c4b6c9344ee3c05b25aa0ee74a4] | committer: Rémi Denis-Courmont 

Set a name for the video window

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5948f590e8482c4b6c9344ee3c05b25aa0ee74a4
---

 modules/video_output/xcb/window.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 9b72f42..ac5344a 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -30,6 +30,8 @@
 
 #include <xcb/xcb.h>
 #include <xcb/xcb_aux.h>
+typedef xcb_atom_t Atom;
+#include <X11/Xatom.h> /* XA_WM_NAME */
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
@@ -70,6 +72,14 @@ struct vout_window_sys_t
     vlc_thread_t thread;
 };
 
+static inline
+void set_ascii_prop (xcb_connection_t *conn, xcb_window_t window,
+                     xcb_atom_t atom, const char *value)
+{
+    xcb_change_property (conn, XCB_PROP_MODE_REPLACE, window, atom,
+                         XA_STRING, 8, strlen (value), value);
+}
+
 /**
  * Create an X11 window.
  */
@@ -114,6 +124,12 @@ static int Open (vlc_object_t *obj)
         goto error;
     }
 
+    /* Plain ASCII localization of VLC for ICCCM window name */
+    set_ascii_prop (conn, window, XA_WM_NAME,
+                    pgettext ("ASCII VLC media player", "VLC media player"));
+    set_ascii_prop (conn, window, XA_WM_ICON_NAME,
+                    pgettext ("ASCII VLC", "VLC"));
+
     wnd->handle.xid = window;
     wnd->p_sys = p_sys;
     wnd->control = Control;




More information about the vlc-devel mailing list