]> git.sesse.net Git - vlc/blobdiff - modules/video_output/xcb/glx.c
XCB: reset the X11 screen saver when displaying a picture
[vlc] / modules / video_output / xcb / glx.c
index 4be6d0df222210cb2bc736494a5b3c2b6f7ab1a3..42ff5cf111a5de4fc69343c73b7d5b14f186c820 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
+#include <vlc_xlib.h>
 #include <vlc_vout_display.h>
 #include <vlc_vout_opengl.h>
 #include "../opengl.h"
@@ -54,9 +55,7 @@ vlc_module_begin ()
     set_capability ("vout display", 50)
     set_callbacks (Open, Close)
 
-    add_shortcut ("xcb-glx")
-    add_shortcut ("glx")
-    add_shortcut ("opengl")
+    add_shortcut ("xcb-glx", "glx", "opengl", "xid")
 vlc_module_end ()
 
 struct vout_display_sys_t
@@ -203,7 +202,7 @@ static int CreateWindow (vout_display_t *vd, xcb_connection_t *conn,
  */
 static int Open (vlc_object_t *obj)
 {
-    if (!XInitThreads ())
+    if (!vlc_xlib_init (obj))
         return VLC_EGENERIC;
 
     vout_display_t *vd = (vout_display_t *)obj;
@@ -377,6 +376,7 @@ static int Open (vlc_object_t *obj)
     /* */
     vout_display_info_t info = vd->info;
     info.has_pictures_invalid = false;
+    info.has_event_thread = true;
 
     /* Setup vout_display_t once everything is fine */
     vd->info = info;
@@ -458,7 +458,7 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
 
 static void PictureRender (vout_display_t *vd, picture_t *pic)
 {
-   vout_display_sys_t *sys = vd->sys;
+    vout_display_sys_t *sys = vd->sys;
 
     vout_display_opengl_Prepare (&sys->vgl, pic);
 }
@@ -466,8 +466,11 @@ static void PictureRender (vout_display_t *vd, picture_t *pic)
 static void PictureDisplay (vout_display_t *vd, picture_t *pic)
 {
     vout_display_sys_t *sys = vd->sys;
+    xcb_connection_t *conn = XGetXCBConnection (sys->display);
 
+    xcb_force_screen_saver (conn, XCB_SCREEN_SAVER_RESET);
     vout_display_opengl_Display (&sys->vgl, &vd->source);
+    xcb_flush (conn);
     picture_Release (pic);
 }