After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 124095 - Wrong window receives focus after closing a spawned window
Wrong window receives focus after closing a spawned window
Status: RESOLVED DUPLICATE of bug 112404
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.2.x
Other Windows
: Normal normal
: Small fix
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-10-08 04:23 UTC by Lenroc
Modified: 2007-01-08 03:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch against gtk+-2.4.1 that sort-of fixes this bug (733 bytes, patch)
2004-07-27 03:30 UTC, Tim Evans
none Details | Review
Improved version of the above patch (2.08 KB, patch)
2006-01-17 23:45 UTC, Tim Evans
none Details | Review

Description Lenroc 2003-10-08 04:23:40 UTC
When Pan (for Windows... haven't checked Linux, but I assume it's not 
there) creates a new Window (for example, the "Browse" interface of 
the "Save Attachments As..." dialog box), and the user dismisses that 
window, the wrong window receives the focus as the spawned window closes.

Steps to reproduce (in Windows):
1. Select a group of messages.
2. Right click on the messages and choose "Save Attachments As..."
3. Click "Browse"
4. Click "Ok"
5. Click "Save"

Expected behavior:
The message attachments begin downloading, and the main window (the 
window with the header list) should receive the focus.

Actual/obseved behavior:
The message attachments begin downloading, but a window from a different 
program receives the focus. The window which receives the focus is the 
window that had the focus just before Pan received the focus. In other 
words, if I am using AIM, and I switch to the main window of Pan, then 
perform the above steps, AIM will receive the focus instead of Pan.

In this case, I am referring to "focus" as meaning the window that is in 
the forefront.
Comment 1 Lenroc 2003-10-08 21:21:17 UTC
The same behavior can be found using different steps as well 
(bringing up different windows).

For example, choosing "News Servers" or "Posting Profiles" from 
the "Tools" menu, the "Open"ing one of the entries, clicking "Ok" 
and then "Close" will have the same effect.

The trick seems to be that the window that the main Pan window 
spawns must spawn it's own window for there to be a problem.
Comment 2 Charles Kerr 2003-11-24 22:23:11 UTC
Can't reproduce under Linux; this appears to be a gtk2-windows problem?
Tor: the dialog in question is a vanilla gtk dialog created with

        dialog = gtk_dialog_new_with_buttons (_("Pan: Save As"),
                    GTK_WINDOW(Pan.window),
                    GTK_DIALOG_DESTROY_WITH_PARENT,
                    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                    GTK_STOCK_SAVE, GTK_RESPONSE_OK,
                    NULL);
Comment 3 Tor Lillqvist 2004-02-01 21:36:40 UTC
Could this be the same issue as bug #107319 ?
Comment 4 Lenroc 2004-02-02 09:18:29 UTC
Yes, 107319 sounds like a specific case of this general (mis)behavior.
Comment 5 Tim Evans 2004-07-27 03:30:43 UTC
Created attachment 29919 [details] [review]
Patch against gtk+-2.4.1 that sort-of fixes this bug

The attached patch goes some way toward fixing the bug.  The right window will
get the focus, but only after the wrong window has had it for a fraction of a
second.  The resulting flicker is not too noticable, and it's certainly better
than not workign at all.
Comment 6 Robert Ögren 2004-08-28 18:42:25 UTC
(This bug is not assigned correctly; reassigning to component owner - win32 maint)
Comment 7 Tim Evans 2006-01-17 23:45:15 UTC
Created attachment 57565 [details] [review]
Improved version of the above patch

The previous patch caused bug #314896 by also acting on skip-taskbar windows, such as popup menus.  The focus was set to the hidden window used as the transient owner, removing focus from the application window.  This patch checks that the owner window is not the hidden window used for skip-taskbar windows before setting it active.
Comment 8 Tor Lillqvist 2007-01-08 03:16:13 UTC

*** This bug has been marked as a duplicate of 112404 ***