Tk Source Code

View Ticket
Login
Ticket UUID: 936195
Title: Reset focus to embedded windows (bug fix)
Type: Patch Version: None
Submitter: matzek Created on: 2004-04-16 09:34:14
Subsystem: 55. [focus] Assigned To: hobbs
Priority: 6 Severity:
Status: Closed Last Modified: 2026-10-22 17:22:38
Resolution: Duplicate Closed By: serhiy.storchaka
    Closed on: 2026-09-19 15:03:56
Description:
This patch provides a fix for handling bogus FocusOut
events as can be observed by using an embedded
application on certain X11 Window managers.

This may be connected to the bugs #740565 and/or #480158.

This patch is against Tk8.4.1 and confirmed to work on
the following Unix systems:
SLES 7 + 8 (ia32);
RHEL 2.1 + 3.0 (ia32);
SLES 8 (s390);
SUN Solaris 5.7, 5.8, 5.9 (Sparc);
AIX 4.3, 5.1, 5.2;
HPUX 11+ (PA-Risc);
Tru64 5.1;

Not tested on other operating systems. This patch was
originally developed by krischan (SF id).
User Comments: serhiy.storchaka added on 2026-09-19 15:03:56:

Same problem as [a4fa3ad2d6]: the window manager moves the X focus back to the container's toplevel and Tk did not pass it on to the embedded application again. Fixed at the event level in [eb2b41d5b3] (branch x11-embed-focus-return), so the application does not need to reset the focus itself.


matzek added on 2004-05-04 15:58:27:
Logged In: YES 
user_id=330806

We had focus problems when embedding another Tk application
into a container. Under some circumstances some
Windowmanagers send FocusOut events to the embedding
application, and it was not possible to get the focus to the
embedded application.

I'll send Krischan an email to have a look at this - maybe
he can explain better, what happend.

hobbs added on 2004-05-04 07:53:14:
Logged In: YES 
user_id=72656

Can I get more bg on this patch?  It doesn't appear to
resolve the named related bugs, but I would like to have
some understanding of what this does solve in case they
could be closely tied.

matzek added on 2004-04-16 16:34:14:

File Added - 83917: tkFocus.c.patch

Attachments: