[vlc-commits] XCB: remove display-level resize events

Rémi Denis-Courmont git at videolan.org
Thu Oct 16 19:26:03 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 12 14:30:25 2014 +0300| [b4190d91c3bc7935d46da01f1a68eabfdcfebd17] | committer: Rémi Denis-Courmont

XCB: remove display-level resize events

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

 modules/hw/vdpau/display.c        |    4 +---
 modules/video_output/xcb/events.c |   20 ++------------------
 modules/video_output/xcb/events.h |    3 +--
 modules/video_output/xcb/glx.c    |    4 +---
 modules/video_output/xcb/x11.c    |    7 +++----
 modules/video_output/xcb/xvideo.c |    4 +---
 6 files changed, 9 insertions(+), 33 deletions(-)

diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index b7f5263..00ac3a5 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -448,8 +448,7 @@ static int Open(vlc_object_t *obj)
         return VLC_ENOMEM;
 
     const xcb_screen_t *screen;
-    uint16_t width, height;
-    sys->embed = XCB_parent_Create(vd, &sys->conn, &screen, &width, &height);
+    sys->embed = XCB_parent_Create(vd, &sys->conn, &screen);
     if (sys->embed == NULL)
     {
         free(sys);
@@ -687,7 +686,6 @@ static int Open(vlc_object_t *obj)
     if (is_fullscreen && vout_window_SetFullScreen(sys->embed, true))
         is_fullscreen = false;
     vout_display_SendEventFullscreen(vd, is_fullscreen);
-    vout_display_SendEventDisplaySize(vd, width, height);
 
     return VLC_SUCCESS;
 
diff --git a/modules/video_output/xcb/events.c b/modules/video_output/xcb/events.c
index 1804e03..84f7124 100644
--- a/modules/video_output/xcb/events.c
+++ b/modules/video_output/xcb/events.c
@@ -85,8 +85,7 @@ static void RegisterEvents (vlc_object_t *obj, xcb_connection_t *conn,
                             xcb_window_t wnd)
 {
     /* Subscribe to parent window resize events */
-    uint32_t value = XCB_EVENT_MASK_POINTER_MOTION
-                   | XCB_EVENT_MASK_STRUCTURE_NOTIFY;
+    uint32_t value = XCB_EVENT_MASK_POINTER_MOTION;
     xcb_change_window_attributes (conn, wnd, XCB_CW_EVENT_MASK, &value);
     /* Try to subscribe to click events */
     /* (only one X11 client can get them, so might not work) */
@@ -127,9 +126,7 @@ static const xcb_screen_t *FindScreen (vlc_object_t *obj,
  */
 vout_window_t *XCB_parent_Create (vout_display_t *vd,
                                   xcb_connection_t **restrict pconn,
-                                  const xcb_screen_t **restrict pscreen,
-                                  uint16_t *restrict pwidth,
-                                  uint16_t *restrict pheight)
+                                  const xcb_screen_t **restrict pscreen)
 {
     vout_window_cfg_t cfg = {
         .type = VOUT_WINDOW_TYPE_XID,
@@ -161,8 +158,6 @@ vout_window_t *XCB_parent_Create (vout_display_t *vd,
         msg_Err (vd, "window not valid");
         goto error;
     }
-    *pwidth = geo->width;
-    *pheight = geo->height;
 
     const xcb_screen_t *screen = FindScreen (VLC_OBJECT(vd), conn, geo->root);
     free (geo);
@@ -245,13 +240,6 @@ static void HandleVisibilityNotify (vout_display_t *vd, bool *visible,
     msg_Dbg (vd, "display is %svisible", *visible ? "" : "not ");
 }
 
-static void
-HandleParentStructure (vout_display_t *vd,
-                       const xcb_configure_notify_event_t *ev)
-{
-    vout_display_SendEventDisplaySize (vd, ev->width, ev->height);
-}
-
 /**
  * Process an X11 event.
  */
@@ -277,10 +265,6 @@ static int ProcessEvent (vout_display_t *vd, xcb_connection_t *conn,
                                     (xcb_visibility_notify_event_t *)ev);
             break;
 
-        case XCB_CONFIGURE_NOTIFY:
-            HandleParentStructure (vd, (xcb_configure_notify_event_t *)ev);
-            break;
-
         /* FIXME I am not sure it is the right one */
         case XCB_DESTROY_NOTIFY:
             vout_display_SendEventClose (vd);
diff --git a/modules/video_output/xcb/events.h b/modules/video_output/xcb/events.h
index c50cd03..ba7a50c 100644
--- a/modules/video_output/xcb/events.h
+++ b/modules/video_output/xcb/events.h
@@ -38,8 +38,7 @@ int XCB_error_Check (vout_display_t *, xcb_connection_t *conn,
 
 struct vout_window_t *XCB_parent_Create (vout_display_t *obj,
                                          xcb_connection_t **,
-                                         const xcb_screen_t **,
-                                         uint16_t *width, uint16_t *height);
+                                         const xcb_screen_t **);
 xcb_cursor_t XCB_cursor_Create (xcb_connection_t *, const xcb_screen_t *);
 
 int XCB_Manage (vout_display_t *vd, xcb_connection_t *conn, bool *);
diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index 76be97a..785a5bc 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -90,10 +90,9 @@ static int Open (vlc_object_t *obj)
     /* Get window, connect to X server (via XCB) */
     xcb_connection_t *conn;
     const xcb_screen_t *scr;
-    uint16_t width, height;
     vout_window_t *surface;
 
-    surface = XCB_parent_Create (vd, &conn, &scr, &width, &height);
+    surface = XCB_parent_Create (vd, &conn, &scr);
     if (surface == NULL)
     {
         free (sys);
@@ -134,7 +133,6 @@ static int Open (vlc_object_t *obj)
     if (vout_window_SetFullScreen (surface, fs))
         fs = false;
     vout_display_SendEventFullscreen (vd, fs);
-    vout_display_SendEventDisplaySize (vd, width, height);
 
     return VLC_SUCCESS;
 
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 1a94803..74928fc 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -115,8 +115,7 @@ static int Open (vlc_object_t *obj)
     /* Get window, connect to X server */
     xcb_connection_t *conn;
     const xcb_screen_t *scr;
-    uint16_t width, height;
-    sys->embed = XCB_parent_Create (vd, &conn, &scr, &width, &height);
+    sys->embed = XCB_parent_Create (vd, &conn, &scr);
     if (sys->embed == NULL)
     {
         free (sys);
@@ -275,7 +274,8 @@ found_format:;
         xcb_create_pixmap (conn, sys->depth, pixmap, scr->root, 1, 1);
         c = xcb_create_window_checked (conn, sys->depth, sys->window,
                                        sys->embed->handle.xid, 0, 0,
-                                       width, height, 0,
+                                       vd->cfg->display.width,
+                                       vd->cfg->display.height, 0,
                                        XCB_WINDOW_CLASS_INPUT_OUTPUT,
                                        vid, mask, values);
         xcb_map_window (conn, sys->window);
@@ -315,7 +315,6 @@ found_format:;
     if (is_fullscreen && vout_window_SetFullScreen (sys->embed, true))
         is_fullscreen = false;
     vout_display_SendEventFullscreen (vd, is_fullscreen);
-    vout_display_SendEventDisplaySize (vd, width, height);
 
     return VLC_SUCCESS;
 
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index e937898..5a69f7c 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -390,8 +390,7 @@ static int Open (vlc_object_t *obj)
     /* Connect to X */
     xcb_connection_t *conn;
     const xcb_screen_t *screen;
-    uint16_t width, height;
-    p_sys->embed = XCB_parent_Create (vd, &conn, &screen, &width, &height);
+    p_sys->embed = XCB_parent_Create (vd, &conn, &screen);
     if (p_sys->embed == NULL)
     {
         free (p_sys);
@@ -594,7 +593,6 @@ static int Open (vlc_object_t *obj)
     if (is_fullscreen && vout_window_SetFullScreen (p_sys->embed, true))
         is_fullscreen = false;
     vout_display_SendEventFullscreen (vd, is_fullscreen);
-    vout_display_SendEventDisplaySize (vd, width, height);
 
     return VLC_SUCCESS;
 



More information about the vlc-commits mailing list