Bug 35091 - EDITING: table or view double-click open with preview mode on: opens in the background (loses focus)
Summary: EDITING: table or view double-click open with preview mode on: opens in the b...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.3.1 release
Hardware: All All
: medium minor
Assignee: Lionel Elie Mamane
URL:
Whiteboard:
Keywords: regression
: 42612 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-07 11:04 UTC by Heinz Repp
Modified: 2021-07-13 04:34 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heinz Repp 2011-03-07 11:04:47 UTC
When opening a table or a query/view from the main database window, the new window opens in the foreground, but focus switches immediately back to the main database window, this coming to the foreground and pushing the newly opened window to the background. Up to OpenOffice 2.4.3 the newly opened window stayed in the foreground and kept the focus. This new behavior is seen with LibO 3.3.0 and 3.3.1. It requires an additional click to the new window to activate it.
Comment 1 ribotb 2011-06-06 04:56:52 UTC
I don't reproduce this problem with LibO 332 (under Windows XP SP3) and LibO 340 (under Windows 7 SP1). 
When opening a table in the main database window, a new window opens in foreground and focus remains on this window. The main database window remains in background.

But maybe I did not understand the problem :-))

Bernard Ribot
Comment 2 Heinz Repp 2011-06-06 06:24:12 UTC
Maybe this is also due to the backend, so further details are here:

Database is an ODB file connected to an ODBC database (sqlite3odbc driver).

Steps:
Open the database, switch to table/query view (left pane)
double click onto one of the tables/queries or select it with mouse or cursor and press return: a new window opens, but immediately the database window returns to the foreground and has focus
but:
select table/query, and then open it via either right click menu: Open or main menu: Edit->Open Database Object, then the new windows stays in the foreground

The faulty behavior is only seen after double click or return key. I see this with:

LibO 3.3.2 on WinXP SP3
LibO 3.3.2 on Ubuntu Lucid

But: when I open the dbase based biblio database, I cannot reproduce this behavior on the same systems, but I can reproduce it with all my ODBC based databases.
Comment 3 Alex Thurgood 2011-06-06 06:41:16 UTC
I can not confirm this behaviour in LibO 3.4 on MacOSX with a mysql ODBC database connection. The table window and the query window appear in the foreground over the top of the ODB main window when I double-click on one of the table/query entries.


Alex
Comment 4 ribotb 2011-06-06 08:56:48 UTC
I tested with :
- an integrated HSQLDB database, 
- a MySQL database (direct connexion). 
In the two cases, it's ok.

Bernard
Comment 5 ribotb 2011-06-06 09:10:44 UTC
I opened a table by :
- double click,
- select and press return,
- right click and open,
- select and Edit > Open Database Object;
It's correct in all cases (table window is in foreground with focus).
Comment 6 Lionel Elie Mamane 2011-11-12 16:01:22 UTC
Bug 42612 and this one are *partially* duplicates.
Comment 7 Heinz Repp 2011-11-13 00:56:22 UTC
Lionel:
thanks for picking up this bug. I read bug 42612, and it seems to me it is indeed a duplicate of this one. With preview disabled my tables open in the foreground as expected, and I already suspected a later event to the main window returns the foceus to this one but didn't think of the preview pane (why should it be redrawn, anyway?).

I already wondered why nobody else seemed to be able to reproduce it. For me it happens on Linux and Windows, in all versions from 3.3.0 up to 3.4.4. Oddly enough, this did not happen with a newly created database but with all production databases in use (using a sqliteodbc backend), but now I see new databases are created with preview disabled - that explains it.

Heinz
Comment 8 Lionel Elie Mamane 2011-11-13 05:21:58 UTC
*** Bug 42612 has been marked as a duplicate of this bug. ***
Comment 9 Lionel Elie Mamane 2011-11-13 05:36:49 UTC
This is a side-effect of how oo.org issue i#99971 (https://issues.apache.org/ooo/show_bug.cgi?id=99971) was fixed (commit 23740dc4a7e81c8c5129e26fe579cf81363d6388).

From a Unix/X11-centric POV, it should be completely reverted, but that will get Microsoft Windows users in arms, so we need a more precise fix for this bug.

Setting preference org.openoffice.Office.Common/View/NewDocumentHandling/ForceFocusAndToFront to false fixes this bug (on X11/GNU/Linux). On X11, it also does not reintroduce i#99971. OTOH, as far is I understand, this would reintroduce i#99971 on MS Windows.

So, I intend to:

1) Make all/most the "steal focus" behaviour happen only on Microsoft Windows, and possibly other platforms that need it, but not on Unix/X11.

2) To fix this bug on MS Windows, too, make showPreview somehow block the effect of ForceFocusAndToFront.
Comment 10 Lionel Elie Mamane 2011-11-13 07:03:55 UTC
(In reply to comment #9)

> 2) To fix this bug on MS Windows, too, make showPreview somehow block the
> effect of ForceFocusAndToFront.

Well, that was easier than expected. Commit 88285f84bdf54147ee5238e97d0d805fa1c127c1 in master (LO 3.5).
Comment 11 Lionel Elie Mamane 2011-11-13 08:01:21 UTC
I'm marking this as fixed, since IMHO it is not an important enough bug to apply the fix to libreoffice-3-4; if someone disagrees and would like it fixed in 3.4.5, feel free to seek review on the development mailing list.
Comment 12 pourvan 2020-11-27 04:08:44 UTC Comment hidden (spam)
Comment 13 wantfall 2020-12-04 05:00:45 UTC Comment hidden (spam)
Comment 14 edencap 2020-12-22 07:09:29 UTC Comment hidden (spam)
Comment 15 marvan 2021-03-31 03:50:19 UTC Comment hidden (spam)
Comment 16 techbeastpk 2021-04-03 06:32:59 UTC Comment hidden (spam)
Comment 17 jonesRebecca 2021-07-13 04:34:23 UTC Comment hidden (spam)