[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdegraphics/kuickshow/src
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2004-07-27 9:27:57
Message-ID: 20040727092757.92A9691D3 () office ! kde ! org
[Download RAW message or body]

CVS commit by lunakl: 

Fix #66784 even for non-netwm wm's or old qt.


  M +18 -0     imlibwidget.cpp   1.15
  M +3 -1      imlibwidget.h   1.12


--- kdegraphics/kuickshow/src/imlibwidget.cpp  #1.14:1.15
@@ -463,4 +463,22 @@ void ImlibWidget::restoreCursor()
 }
 
+// Reparenting a widget in Qt in fact means destroying the old X window of the widget
+// and creating a new one. And since the X window used for the Imlib image is a child
+// of this widget's X window, destroying this widget's X window would mean also
+// destroying the Imlib image X window. Therefore it needs to be temporarily reparented
+// away and reparented back to the new X window.
+// Reparenting may happen e.g. when doing the old-style (non-NETWM) fullscreen changes.
+void ImlibWidget::reparent( QWidget* parent, WFlags f, const QPoint& p, bool showIt )
+{
+    XWindowAttributes attr;
+    XGetWindowAttributes( x11Display(), win, &attr );
+    XUnmapWindow( x11Display(), win );
+    XReparentWindow( x11Display(), win, attr.root, 0, 0 );
+    QWidget::reparent( parent, f, p, showIt );
+    XReparentWindow( x11Display(), win, winId(), attr.x, attr.y );
+    if( attr.map_state != IsUnmapped )
+        XMapWindow( x11Display(), win );
+}
+
 //----------
 

--- kdegraphics/kuickshow/src/imlibwidget.h  #1.11:1.12
@@ -172,4 +172,6 @@ public:
   ImlibData*    getImlibData() const           { return id;               }
 
+  virtual void  reparent( QWidget* parent, WFlags f, const QPoint& p, bool showIt = FALSE );
+
 public slots:
   void          rotate90();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic