Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37888032
en ru br
Репозитории ALT
S:3.3.8d-alt16.1
5.1: 3.3.8b-alt7
4.1: 3.3.8b-alt2.qa1
4.0: 3.3.8b-alt0.M40.1
3.0: 3.3.4-alt6
+updates:3.3.4-alt6.3.M30
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: qt3

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: 0059-qpopup_has_mouse.patch
Скачать


qt-bugs@ issue : 49417
bugs.kde.org number : 58719
applied: no
author: Lubos Lunak <l.lunak@kde.org>
Hello,
 please consider applying the two attached QPopupMenu patches fixing KDE bugs 
 #58719 and #74778 (http://bugs.kde.org/show_bug.cgi?id=58719, 
 http://bugs.kde.org/show_bug.cgi?id=74778), which complain about keyboard 
 navigation in popup menus being very uncomfortable because of being affected 
 by mouse position despite mouse not being used at all.
 
 - hasmouse.patch - (#58719) - use keyboard to open and navigate in any popup 
 menu and "accidentally" hit your mouse. Depending on the mouse cursor 
 position either no popup entry is selected or the random popup entry 
 happening to be at the cursor position becomes highlighted. The patch 
 basically copies the 'hasmouse' code from QMenuBar which prevents the mouse 
 having any effect on the popup if it's outside the popup geometry.
 [ ... #74778 ... ] 
 
--- src/widgets/qpopupmenu.cpp.sav	2004-05-25 21:58:23.000000000 +0200
+++ src/widgets/qpopupmenu.cpp	2004-05-25 22:02:19.520297888 +0200
@@ -253,6 +253,7 @@ public:
     } scroll;
     QSize calcSize;
     QRegion mouseMoveBuffer;
+    uint hasmouse : 1;
 };
 
 static QPopupMenu* active_popup_menu = 0;
@@ -272,6 +273,7 @@ QPopupMenu::QPopupMenu( QWidget *parent,
     d->scroll.scrollableSize = d->scroll.topScrollableIndex = 0;
     d->scroll.scrollable = QPopupMenuPrivate::Scroll::ScrollNone;
     d->scroll.scrolltimer = 0;
+    d->hasmouse = 0;
     isPopupMenu	  = TRUE;
 #ifndef QT_NO_ACCEL
     autoaccel	  = 0;
@@ -1740,6 +1742,11 @@ void QPopupMenu::mouseMoveEvent( QMouseE
 
     int	 item = itemAtPos( e->pos() );
     if ( item == -1 ) {				// no valid item
+        if( !d->hasmouse ) {
+            tryMenuBar( e );
+            return;
+        }
+        d->hasmouse = 0;
 	int lastActItem = actItem;
 	actItem = -1;
 	if ( lastActItem >= 0 )
@@ -1751,6 +1758,7 @@ void QPopupMenu::mouseMoveEvent( QMouseE
 	}
     } else {					// mouse on valid item
 	// but did not register mouse press
+        d->hasmouse = 1;
 	if ( (e->state() & Qt::MouseButtonMask) && !mouseBtDn )
 	    mouseBtDn = TRUE; // so mouseReleaseEvent will pop down
 
@@ -2159,6 +2167,7 @@ void QPopupMenu::timerEvent( QTimerEvent
 */
 void QPopupMenu::leaveEvent( QEvent * )
 {
+    d->hasmouse = 0;
     if ( testWFlags( WStyle_Tool ) && style().styleHint(QStyle::SH_PopupMenu_MouseTracking, this) ) {
 	int lastActItem = actItem;
 	actItem = -1;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin