Opened 18 years ago

Closed 17 years ago

Last modified 15 years ago

#2483 closed defect (fixed)

Problem with focus of the search dialog

Reported by: cmiramon@… Owned by: lasgouttes
Priority: high Milestone:
Component: search Version: 1.4.0
Severity: major Keywords:
Cc: younes@…

Description

1) Open a document
2) Ctrl-F, search for a word
3) Click in the text
4) Ctrl-F again. The search dialog comes to the foreground but does not have
focus. You have to click in it to be able to enter a new search phrase.

Could it be possible to give back focus to the search dialog ?

I'm using the Qt2 frontend.

Cheers,
Charles

Change History (16)

comment:1 by Uwe Stöhr, 18 years ago

op_sys: LinuxAll
Summary: Problem with focus of the search dialog Problem with focus of the search dialog

comment:2 by jug, 18 years ago

Confirmed with Qt4 in trunk.

comment:3 by Uwe Stöhr, 17 years ago

Cc: younes.a@… added

Abdel, perhaps you have a quick fix for this.

comment:4 by younes, 17 years ago

Keywords: fixedintrunk added

Fixed in trunk at revision 17381. I guess the same fix could apply to 1.4.

comment:5 by Uwe Stöhr, 17 years ago

Milestone: 1.4.5

comment:6 by lasgouttes, 17 years ago

I cannot reproduce the bug in 1.4. I'd like to see what happens before applying it

comment:7 by younes, 17 years ago

Severity: minormajor

Under windows, the bug is even more serious in 1.4: When you type "Ctrl+f" and
if the search dialog is already opened somewhere in the background, it is put to
the the foreground but does not have focus at all as the original report says.
This is a major bug IMO. Maybe you can backport part of the commit 17166
(relevant part pasted below).

In 1.5, the search dialog had the focus but not the edit box within the dialog.
So I guess my fix to 1.5 does not apply to 1.4 then.

Author: younes
Date: Tue Feb 13 19:20:07 2007
New Revision: 17166

URL: http://www.lyx.org/trac/changeset/17166
Log:
Fix #3225 and maybe others as well.

  • QDialogView::show(): also setFocus() when raising or showing a window.

http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/qt4/QDialogView.C?rev=17166
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/QDialogView.C (original)
+++ lyx-devel/trunk/src/frontends/qt4/QDialogView.C Tue Feb 13 19:20:07 2007
@@ -61,8 +61,10 @@

if (form()->isVisible()) {

form()->raise();
form()->activateWindow();

+ form()->setFocus();

} else {

form()->show();

+ form()->setFocus();

}

}


comment:8 by lasgouttes, 17 years ago

So it is probably a windows only problem. On linux, I cannot put the window in
the background anyway...

It is strange that we need to set the focus, it should be the job of the window
manager, isn't it?

comment:9 by lasgouttes, 17 years ago

Charles, could you try the patch of comment 5 with 1.4 and see whether
it helps? Alternatively, what are the KDE settings I need to have to
see the problem?

comment:10 by cmiramon@…, 17 years ago

No. With the patch Number 5 applied the problem is still there.

This patch works for me :

Index: QDialogView.C
===================================================================
--- QDialogView.C (révision 17647)
+++ QDialogView.C (copie de travail)
@@ -58,8 +58,12 @@

if (form()->isVisible()) {

form()->raise();

+ form()->setActiveWindow();
+ form()->setFocus();

} else {

form()->show();

+ form()->setActiveWindow();
+ form()->setFocus();

}

}

Hehe, my first patch...

comment:11 by lasgouttes, 17 years ago

And are you sure this has no bad side-effects?

Am I right that this should be simplified as

if (form()->isVisible()) {

form()->raise();

} else {

form()->show();

}

+ form()->setActiveWindow();
+ form()->setFocus();

}

comment:12 by lasgouttes, 17 years ago

Charles? Still happy with the patch? Shall I apply it?

comment:13 by lasgouttes, 17 years ago

Milestone: 1.4.51.4.x

Too late :)

comment:14 by Richard Heck, 17 years ago

Resolution: fixed
Status: newclosed

New stable series is 1.5.x.

comment:15 by ps@…, 15 years ago

Keywords: fixedintrunk removed

comment:16 by lasgouttes, 9 years ago

Milestone: 1.4.x

Remove milestone 1.4.x, which is not a real milestone anyway.

Note: See TracTickets for help on using tickets.