The current GTK widget does not set the focus if it receives a mouse button pressed event.
Created attachment 16627 [details] Grabbing widget focus in mouse press callback. This patch copies the solution of the QT widget, which sets the widget focus in mouse press and double click callback. I also copied a FIXME comment from the QT code. I'm not sure if it is relevant.
Created attachment 16628 [details] Grabbing widget focus in mouse press callback. Argh... I missed a tab. Reposting.
Created attachment 16629 [details] Grabbing widget focus in mouse press callback. Fixing wrong spaced braces.
Someone who knows Gtk should look at this.
Comment on attachment 16629 [details] Grabbing widget focus in mouse press callback. The focus issues need some real attention, but if this small patch helps your use case then it can go in.
Landed in r27168.
Alp: thanks for accepting it! Yes, it helps my use case because now the focussing in my multi-paned application works as expected. Before clicking in the WebKit widget had the focus still sitting in some other widget and any following key navigation navigated the wrong widget. So it is an improvement from the embedders viewpoint. With this merged I'll try to understand the code and see why the cursor key navigation when having focus doesn't work for me.