mouse pointer (2)

Carles Pina i Estany <[email protected]>
Newsgroups gmane.comp.kde.gwenview
Message-ID <[email protected]>
Hello,

I'm sorry: my last patch about mouse pointer was not correct.
To hide and show the mous pointer, in gwenview, was already handled by
gwenview. The main problem is that, after changing photos, is shown
again. And yes, I browse photos very fast, faster than 5 seconds that is
hidden (so I am always seeing the pointer).

Attached there is a patch: I save the state and I restore or not restore
in function of the state. Very rare: I haven't been able to "query"
using Qt functions which is the current QCursor (else I wouldn't need a
new variable member).

Angelo: I know that we should wait Aurélien. But I send to "public-save"
and for testing :-)

-- 
Carles Pina i Estany		GPG id: 0x8CBDAE64
	http://pinux.info	Manresa - Barcelona

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

_______________________________________________
Gwenview-general mailing list
Gwenview-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/gwenview-general
hide_pointer.patch (text/x-diff, 1.5 KB)
Index: gvcore/imageviewcontroller.cpp
===================================================================
--- gvcore/imageviewcontroller.cpp	(revision 699377)
+++ gvcore/imageviewcontroller.cpp	(working copy)
@@ -98,7 +98,9 @@
 	ImageView* mImageView;
 	KActionPtrList mImageViewActions;
 	
+	// Hide cursor stuff
 	QTimer* mAutoHideTimer;
+	bool mCursorHidden;
 	
 	KParts::ReadOnlyPart* mPlayerPart;
 	
@@ -269,6 +271,7 @@
 	d->mDocument=document;
 	d->mActionCollection=actionCollection;
 	d->mAutoHideTimer=new QTimer(this);
+	d->mCursorHidden=false;
 
 	d->mContainer=new QWidget(parent);
 	d->mContainer->setMinimumWidth(1); // Make sure we can resize the toolbar smaller than its minimum size
@@ -349,6 +352,7 @@
 	} else {
 		d->mAutoHideTimer->stop();
 		QApplication::restoreOverrideCursor();
+		d->mCursorHidden=false;
 	}
 
 	d->mToolBar->setHidden(d->mFullScreen);
@@ -394,6 +398,7 @@
 	QWidget* widget = KApplication::kApplication()->activeWindow();
 	if (!widget || !widget->inherits("QDialog")) {
 		QApplication::setOverrideCursor(blankCursor);
+		d->mCursorHidden=true;
 	}
 }
 
@@ -429,7 +434,16 @@
 	if (!isAChildOfStack) return false;
 
 	d->updateFullScreenBarPosition();
-	QApplication::restoreOverrideCursor();
+
+	if (event->type()==QEvent::MouseMove) d->mCursorHidden=false;
+	
+	if (d->mCursorHidden==true) {
+		QApplication::setOverrideCursor(blankCursor,true);
+	}
+	else {
+		QApplication::restoreOverrideCursor();
+	}
+
 	d->restartAutoHideTimer();
 	return false;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.