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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/shells/desktop
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2008-11-15 5:12:37
Message-ID: 1226725957.780519.18755.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 884494 by aseigo:

after much painfulness with X11 (oh, how i despise thee!) turn off the glow for now \
until i figure out a brilliant way to propagate events properly


 M  +22 -3     panelview.cpp  
 M  +7 -0      panelview.h  
 M  +17 -20    plasmaapp.cpp  


--- trunk/KDE/kdebase/workspace/plasma/shells/desktop/panelview.cpp #884493:884494
@@ -835,9 +835,14 @@
     return m_timeLine;
 }
 
+QRect PanelView::unhideHintGeometry() const
+{
+    return m_unhideTriggerGeom;
+}
+
 void PanelView::hintOrUnhide(const QPoint &point)
 {
-    if (!PlasmaApp::hasComposite()) {
+    if (!shouldHintHide()) {
         unhide();
         return;
     }
@@ -1019,6 +1024,11 @@
     }*/
 }
 
+bool PanelView::shouldHintHide() const
+{
+    return false; // PlasmaApp::hasComposite();
+}
+
 void PanelView::createUnhideTrigger()
 {
 #ifdef Q_WS_X11
@@ -1026,7 +1036,7 @@
         return;
     }
 
-    bool fancy = PlasmaApp::hasComposite();
+    bool fancy = shouldHintHide();
     int actualWidth = 1;
     int actualHeight = 1;
     int triggerWidth = fancy ? 30 : 1;
@@ -1083,7 +1093,14 @@
     attributes.event_mask = EnterWindowMask;
 
     if (fancy) {
-        attributes.event_mask |= LeaveWindowMask | PointerMotionMask;
+        attributes.event_mask = EnterWindowMask | LeaveWindowMask | \
PointerMotionMask | +                                KeyPressMask | KeyPressMask | \
ButtonPressMask | +                                ButtonReleaseMask | \
ButtonMotionMask | +                                KeymapStateMask | \
VisibilityChangeMask | +                                StructureNotifyMask | \
ResizeRedirectMask | +                                SubstructureNotifyMask |
+                                SubstructureRedirectMask | FocusChangeMask |
+                                PropertyChangeMask | ColormapChangeMask | \
OwnerGrabButtonMask;  }
 
     unsigned long valuemask = CWOverrideRedirect | CWEventMask;
@@ -1092,6 +1109,7 @@
                                     0, CopyFromParent, InputOnly, CopyFromParent,
                                     valuemask, &attributes);
     XMapWindow(QX11Info::display(), m_unhideTrigger);
+    m_unhideTriggerGeom = QRect(triggerPoint, QSize(triggerWidth, triggerHeight));
     m_triggerZone = QRect(actualTriggerPoint, QSize(actualWidth, actualHeight));
 //    KWindowSystem::setState(m_unhideTrigger, NET::StaysOnTop);
 
@@ -1109,6 +1127,7 @@
 
     XDestroyWindow(QX11Info::display(), m_unhideTrigger);
     m_unhideTrigger = None;
+    m_triggerZone = m_unhideTriggerGeom = QRect();
 #endif
 
     //kDebug();
--- trunk/KDE/kdebase/workspace/plasma/shells/desktop/panelview.h #884493:884494
@@ -113,6 +113,11 @@
     void hintOrUnhide(const QPoint &point);
 
     /**
+     * Returns the geometry of the current unhide hint window
+     */
+    QRect unhideHintGeometry() const;
+
+    /**
      * Hides any hide hinting
      */
     void unhintHide();
@@ -169,6 +174,7 @@
 private:
     void createUnhideTrigger();
     void destroyUnhideTrigger();
+    bool shouldHintHide() const;
     Qt::Alignment alignmentFilter(Qt::Alignment align) const;
     bool isHorizontal() const;
     QTimeLine *timeLine();
@@ -210,6 +216,7 @@
 #ifdef Q_WS_X11
     Window m_unhideTrigger;
     QRect m_triggerZone;
+    QRect m_unhideTriggerGeom;
 #endif
 
     QSizeF m_lastMin;
--- trunk/KDE/kdebase/workspace/plasma/shells/desktop/plasmaapp.cpp #884493:884494
@@ -337,24 +337,21 @@
 
 bool PlasmaApp::x11EventFilter(XEvent *event)
 {
-    if (m_panelHidden) {
-        if (event->type == EnterNotify) {
-            PanelView *panel = findPanelForTrigger(event->xcrossing.window);
-            if (panel) {
+    if (m_panelHidden && event->xany.send_event != True) {
+        PanelView *panel = findPanelForTrigger(event->xcrossing.window);
+        if (panel) {
+            if (event->type == EnterNotify) {
                 panel->hintOrUnhide(QPoint());
-            }
-        } else if (event->type == LeaveNotify) {
-            PanelView *panel = findPanelForTrigger(event->xcrossing.window);
-            if (panel) {
+            } else if (event->type == LeaveNotify) {
+                PanelView *panel = findPanelForTrigger(event->xcrossing.window);
                 panel->unhintHide();
-            }
-        } else if (event->type == MotionNotify) {
-            PanelView *panel = findPanelForTrigger(event->xcrossing.window);
-            if (panel) {
+            } else if (event->type == MotionNotify) {
                 XMotionEvent *motion = (XMotionEvent*)event;
                 //kDebug() << "motion" << motion->x << motion->y << \
                panel->location();
                 panel->hintOrUnhide(QPoint(motion->x_root, motion->y_root));
             }
+
+            return true;
         }
     }
 
@@ -417,13 +414,12 @@
 void PlasmaApp::screenResized(Kephal::Screen *s, QSize oldSize, QSize newSize)
 {
     // TODO: that check should not be necessary, fix kephal
-    if (oldSize == newSize) 
+    if (oldSize == newSize) {
         return;
-    
-    DesktopView *view = viewForScreen(s->id());
+    }
 
+    DesktopView *view = viewForScreen(s->id());
     kDebug() << "adjust size for screen" << s->id() << oldSize << newSize << view;
-
     view->adjustSize();
 
     //TODO: should we remove panels when the screen
@@ -435,16 +431,17 @@
             panel->pinchContainment(s->geom());
         }
     }
-    
+
     kDebug() << "Done.";
 }
 
 void PlasmaApp::screenMoved(Kephal::Screen *s, QPoint oldPosition, QPoint \
newPosition)  {
     // TODO: that check should not be necessary, fix kephal
-    if (oldPosition == newPosition) 
+    if (oldPosition == newPosition)  {
         return;
-    
+    }
+
     DesktopView *view = viewForScreen(s->id());
     kDebug() << "adjust size for screen" << s->id() << oldPosition << newPosition << \
view;  view->adjustSize();
@@ -452,7 +449,6 @@
 }
 
 
-
 DesktopView* PlasmaApp::viewForScreen(int screen) const
 {
     foreach (DesktopView *view, m_desktops) {
@@ -538,6 +534,7 @@
 
 bool PlasmaApp::hasComposite()
 {
+//    return true;
 #ifdef Q_WS_X11
     return colormap && KWindowSystem::compositingActive();
 #else


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

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