Closed Bug 432187 Opened 16 years ago Closed 8 years ago

XULRunner's focus code doesn't play well with gtk on windows

Categories

(Core Graveyard :: Embedding: APIs, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: ben, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en; rv:1.8.1.14) Gecko/20080418 Epiphany/2.20 Firefox/2.0.0.14
Build Identifier: 

I was trying to embed XULRunner in a GTK app that I was developing on windows.  However, the differences between XULRunner's and GTK's focus models make it very tricky to do.  The main problem is that GTK expects it's top-level window to have the the Window's focus at all times.  It tracks which child window has focus internally.  However, XULRunner takes the focus for itself and this leads to problems.

I'm not sure what the right way to fix this problem is.  Switching focus models seems impossible.  Maybe XULRunner could work with the GTK Plug/Socket interface?  Maybe there could be code in XULRunner to hack around the problems?  At the very least, the problems should be documented and steps should be given to work around the issues.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
I'm attaching the code that I needed to write to make GTK and XULRunner work together.  It probably doesn't fix all the issues, but it's a start.  This code does a couple things:

1) When XULRunner has focus and the user clicks on a GTK widget, we have GTK focus it's top-level window.  Otherwise GTK widgets will not accept focus until we switch to a different app, then switch back.

2) When GTK's toplevel window loses focus to a XULRunner browser widget, we don't let GTK see the WM_KILLFOCUS message.  Otherwise it takes 2 mouse clicks for GTK to focus a widget after XULRunner has focus.

3) When the browser window is clicked on, we give the GTK widget that contains it focus.  Otherwise GTK will still think that it's currently focused widget still has focus.  For example if a GtkEntry widget was the last widget to have focus, then it will still display a blinking cursor.
Marking a bunch of bugs in the "Embedding: APIs" component INCOMPLETE in preparation to archive that component. If I have done this incorrectly, please reopen the bugs and move them to a more correct component as we don't have "embedding" APIs any more.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: