patches/qt3-0018-qpopup_has_mouse.patch
author moinakg
Thu, 10 Jan 2008 18:27:45 +0000
changeset 782 a013313b88b4
permissions -rw-r--r--
QT3 Spec file and patches, initial revision.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
782
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     1
--- qt-x11-free-3.3.8/src/widgets/qpopupmenu.cpp.orig	2007-02-02 19:31:23.000000000 +0530
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     2
+++ qt-x11-free-3.3.8/src/widgets/qpopupmenu.cpp	2008-01-08 22:45:36.500530694 +0530
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     3
@@ -253,6 +253,7 @@
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     4
     } scroll;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     5
     QSize calcSize;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     6
     QRegion mouseMoveBuffer;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     7
+    uint hasmouse : 1;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     8
 };
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
     9
 
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    10
 static QPopupMenu* active_popup_menu = 0;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    11
@@ -272,6 +273,7 @@
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    12
     d->scroll.scrollableSize = d->scroll.topScrollableIndex = 0;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    13
     d->scroll.scrollable = QPopupMenuPrivate::Scroll::ScrollNone;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    14
     d->scroll.scrolltimer = 0;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    15
+    d->hasmouse = 0;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    16
     isPopupMenu	  = TRUE;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    17
 #ifndef QT_NO_ACCEL
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    18
     autoaccel	  = 0;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    19
@@ -1741,6 +1743,11 @@
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    20
 
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    21
     int	 item = itemAtPos( e->pos() );
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    22
     if ( item == -1 ) {				// no valid item
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    23
+        if( !d->hasmouse ) {
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    24
+            tryMenuBar( e );
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    25
+            return;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    26
+        }
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    27
+        d->hasmouse = 0;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    28
 	int lastActItem = actItem;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    29
 	actItem = -1;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    30
 	if ( lastActItem >= 0 )
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    31
@@ -1752,6 +1759,7 @@
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    32
 	}
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    33
     } else {					// mouse on valid item
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    34
 	// but did not register mouse press
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    35
+        d->hasmouse = 1;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    36
 	if ( (e->state() & Qt::MouseButtonMask) && !mouseBtDn )
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    37
 	    mouseBtDn = TRUE; // so mouseReleaseEvent will pop down
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    38
 
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    39
@@ -2160,6 +2168,7 @@
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    40
 */
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    41
 void QPopupMenu::leaveEvent( QEvent * )
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    42
 {
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    43
+    d->hasmouse = 0;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    44
     if ( testWFlags( WStyle_Tool ) && style().styleHint(QStyle::SH_PopupMenu_MouseTracking, this) ) {
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    45
 	int lastActItem = actItem;
a013313b88b4 QT3 Spec file and patches, initial revision.
moinakg
parents:
diff changeset
    46
 	actItem = -1;