[vlc-commits] XCB windowless: respect top/left offset

Cheng Sun git at videolan.org
Tue Jan 1 16:13:20 CET 2013


npapi-vlc | branch: master | Cheng Sun <chengsun9 at gmail.com> | Sun Dec 30 22:47:33 2012 +0000| [d41934d681cbf67a20dd761450fae4f79921a212] | committer: Jean-Baptiste Kempf

XCB windowless: respect top/left offset

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 npapi/vlcwindowless_xcb.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/npapi/vlcwindowless_xcb.cpp b/npapi/vlcwindowless_xcb.cpp
index e035eb2..e4fe0eb 100644
--- a/npapi/vlcwindowless_xcb.cpp
+++ b/npapi/vlcwindowless_xcb.cpp
@@ -74,8 +74,8 @@ void VlcWindowlessXCB::drawBackground(xcb_drawable_t drawable)
     uint32_t        values[2]  = {colorpixel, 0};
     xcb_create_gc(m_conn, background, drawable, mask, values);
     xcb_rectangle_t rect;
-    rect.x = 0;
-    rect.y = 0;
+    rect.x = npwindow.x;
+    rect.y = npwindow.y;
     rect.width = npwindow.width;
     rect.height = npwindow.height;
 
@@ -106,8 +106,8 @@ bool VlcWindowlessXCB::handle_event(void *event)
             break;
 
         /* Compute the position of the video */
-        int left = (npwindow.width  - m_media_width)  / 2;
-        int top  = (npwindow.height - m_media_height) / 2;
+        int left = npwindow.x + (npwindow.width  - m_media_width)  / 2;
+        int top  = npwindow.y + (npwindow.height - m_media_height) / 2;
 
         gc = xcb_generate_id(m_conn);
         xcb_create_gc(m_conn, gc, xgeevent->drawable, 0, NULL);



More information about the vlc-commits mailing list