Bug 71532 - Reinvoking grep function should set focus to dialog if already open
Summary: Reinvoking grep function should set focus to dialog if already open
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-31 04:33 UTC by Jon Smirl
Modified: 2004-01-03 17:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Smirl 2003-12-31 04:33:48 UTC
Version:           CVS (using KDE Devel)
Installed from:    Compiled sources

I was running full screen mode.
I started a grep and got the dialog.
I went to click on it and missed.
This cause the dialog to end up behind the full screen window and not be visible.
So I said ok, just select grep again.
But this doesn't bring the window to the foreground.

I had to exit full screen mode and move around my windows until I found the dialog.

Reinvoking the grep function should force the dialog to the foreground if it is already open.
Comment 1 Jens Dagerbo 2003-12-31 11:17:02 UTC
The grep dialog shouldn't be allowed to end up below the fullscreen kdevelop window in the first place.

And on my (KDE-3.2 CVS) system I find no way of getting it below the main window. I suspect this is only possible with the old kwin implementation (pre 3.2). If that is the case, I think this is too much of a special case to be  worth the hassle to try to work around.

Anyone seeing this on KDE-3.2?
Comment 2 Jon Smirl 2003-12-31 15:06:26 UTC
You can do this non-full screen too. I'm on Fedora but I'm running with current kdebase and libs.
Comment 3 Harald Fernengel 2004-01-02 17:52:04 UTC
Subject: kdevelop/parts/grepview

CVS commit by harald: 

if you lose this non-modal dialog somewhere behind your main window, make sure
it is brought to front when the action is called again.

CCMAIL: 71532-done@bugs.kde.org


  M +10 -0     grepdlg.cpp   1.23
  M +1 -5      grepdlg.h   1.6


--- kdevelop/parts/grepview/grepdlg.cpp  #1.22:1.23
@@ -276,3 +276,13 @@ void GrepDialog::slotSearchClicked()
 }
 
+void GrepDialog::show()
+{
+    // not beautiful, but works with all window
+    // managers and Qt versions
+    if (isVisible())
+        QDialog::hide();
+    QDialog::show();
+    pattern_combo->setFocus();
+}
+
 #include "grepdlg.moc"

--- kdevelop/parts/grepview/grepdlg.h  #1.5:1.6
@@ -49,9 +49,5 @@ public:
     bool recursiveFlag() const
         { return recursive_box->isChecked(); }
-    void show()
-    {
-        pattern_combo->setFocus();
-        QDialog::show();
-    }
+    void show();
 
 #ifdef IGNORE_SCM_DIRS


Comment 4 Jon Smirl 2004-01-03 17:51:01 UTC
Why isn't the grep dialog modal with the app as it's parent? If it was modal it wouldn't have this problem. What's the advantage to the non-modal version?