This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Kourse 1] Patch - Bug 160880: Alt-Tab while in region capture mode prevents exit

Tags: None
(comma "," separated)
User avatar
msoeken
Mentor
Posts
300
Karma
4
OS
This is a patch from ComaWhite with some modifications by Linex. It looks good, but there are some problems with it. I tried it and got back the focus as whished, but after Alt+Tabbing several times, I cannot exit ksnapshot anymore. But I think, you are on a good way.
Code: Select all
Index: regiongrabber.cpp                                           
===================================================================
--- regiongrabber.cpp   (revision 904431)                         
+++ regiongrabber.cpp   (working copy)                             
@@ -182,6 +182,17 @@
     selection = r;
 }

+bool RegionGrabber::event( QEvent* e )
+{
+    if ( e->type() == QEvent::WindowDeactivate ) {
+        activateWindow();
+        raise();
+        return true;
+    }
+
+    return QWidget::event( e );
+}
+
 void RegionGrabber::mousePressEvent( QMouseEvent* e )
 {
     showHelp = false;
Index: regiongrabber.h
===================================================================
--- regiongrabber.h     (revision 904431)
+++ regiongrabber.h     (working copy)
@@ -45,6 +45,7 @@
     void regionGrabbed( const QPixmap & );

 protected:
+    bool event( QEvent* e );
     void paintEvent( QPaintEvent* e );
     void resizeEvent( QResizeEvent* e );
     void mousePressEvent( QMouseEvent* e );

Last edited by sayakb on Fri Jan 02, 2009 5:49 pm, edited 1 time in total.


Image
[size=x-small]code | [url=cia.vc/stats/author/msoeken]cia.vc[/url] | [url=kde.org/support]donating KDE[/url] | [url=tinyurl.com/cto4ns]wishlist[/url][/size]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Sogou [Bot], Yahoo [Bot]