GtkSocket: focus to embedded child widget or plug widget

2014-05-05 Thread Gaute Hope
Hi,

note: this message was already sent to gtk-list, but re-sending here as it
might be more appropriate:

I am trying to put the keyboard focus on a widget (or similar) inside a
embedded window of a GtkSocket, but although I am using grab_focus on
the GtkSocket and the plugin seems to be receiving the events (at least
the socket-side window is not anymore) the widget or window does not
have keyboard focus. E.g. in the case of a simple plug with a GtkEntry,
the entry does not have cursor, or if I embed gvim the gvim cursor is
not blinking/active.

I have submitted a bug here:
https://bugzilla.gnome.org/show_bug.cgi?id=729248

I am using Gtk+ git.

It turns out it is possible to give focus to the first widget by
'Tab'-ing into the embedded child, but it does not seem to be a way to
do this programtically. The specific XEMBED signals that are required to
be sent [0] can, as far as I can see, only be sent through the GtkSocket
by the tab-handler.

grab_focus() sends a XEMBED_FOCUS_IN message but with an
XEMBED_FOCUS_CURRENT detail, by replacing ..._CURRENT with _FIRST
the embedded child acts as if Tab has been pressed and the first widget
gets focus.

As you can see from the bug report I created a patch for Gtk where I can
send the focus_forward and backward ( _FIRST and _LAST ) signals. When I
use it the focus changes as expected.

A small example based on gtkmm's socket and plug examples can be found
here:
https://github.com/gauteh/plug-socket-grab-focus/tree/focus_forward

After some discussion on #gtk+ we've also discovered that the testsocket
program appears to give focus to the plugin entry field, but the entry
does not get any key events before it is clicked.

If there is no other way of programatically changing the focus of the
embedded plugin I would greatly appreciate either something like the
patch I include in the bug report or some other way to control the focus
from the socket-side.

By the way, thanks for the helpful discussions on #gtk+.

Best regards, Gaute

[0] 
http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html#idm139742756373280
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Your answer in Gnome maillinglist for menu_items

2014-05-05 Thread Emmanuele Bassi
hi;

GtkMenuItem is a GtkBin, so you can use gtk_container_add() to set a
child of a GtkMenuItem like you would do with any other container
inside GTK+.

ciao,
 Emmanuele.


On 5 May 2014 13:23, Jürgen Holtorf tm...@juergens-ecke.de wrote:
 Hallo

 The mailing list seams not to work in the moment so i take the direct way to
 contact you.

 You wrote:

  * GtkMenuItem, pack an icon with a label inside an horizontal box,
 and pack the box in the menu item

 The First part creating a box with icon is clear to me, but i can't
 find a function to pack the box in the menu item please can you give
 me a hint, or better an example.

 Thanks in advance

 Jürgen Holtorf








-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Physically based kinetic scrolling

2014-05-05 Thread Bastien Nocera
Hey,

On Mon, 2014-05-05 at 13:58 +0100, Lieven van der Heide wrote:
 I modified the scrolled windows kinetic scrolling to match the actual
 physics laws for friction and springs. IMHO, this gives a much more
 pleasing result. 
 
 
 
 A branch with these changes is at
 
 
 https://github.com/lievenvanderheide/gtk-kineticscrolling
 
 
 I hope that someone can have a look at it, and maybe merge it into the
 main gtk branch.

Very interesting work. You should create a bug in the GNOME Bugzilla,
and attached a patch that squashes your 2 commits from your git tree.
The patch review will be done in Bugzilla instead. You'll at least want
to add a more detailed commit explaining all the changes you've made.

Cheers


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Physically based kinetic scrolling

2014-05-05 Thread Bastien Nocera
On Mon, 2014-05-05 at 10:04 -0400, Hashem Nasarat wrote:
 Sweet feature! But
 
 Is this legal to implement? As far as I know, doesn't a portion of the
 Apple v Samsung trial have to do with the way Samsung implemented touch
 scrolling? Also, aren't apple's patents the reason why Android doesn't
 have the bounce animation in their scrolling lists?
 
 I'm not a lawyer, but these two patents seem to describe what you have
 implemented (and to a lesser degree, the pre-existing touch physics in
 GTK+).

Don't discuss, or link to patents on the developer list. The less we
know, the less we are likely to infringe, or the less likely we are to
be condemned for infringing if that were to be the case.

It's the same reason why we don't go scouring patent archives when
implementing or designing new features.

Cheers

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Physically based kinetic scrolling

2014-05-05 Thread Hashem Nasarat
Ah ok. Thanks for the tip. I suppose replies to this thread should only
CC legal-l...@gnome.org then.


On 05/05/2014 10:09 AM, Bastien Nocera wrote:
 On Mon, 2014-05-05 at 10:04 -0400, Hashem Nasarat wrote:
 Sweet feature! But

 Is this legal to implement? As far as I know, doesn't a portion of the
 Apple v Samsung trial have to do with the way Samsung implemented touch
 scrolling? Also, aren't apple's patents the reason why Android doesn't
 have the bounce animation in their scrolling lists?

 I'm not a lawyer, but these two patents seem to describe what you have
 implemented (and to a lesser degree, the pre-existing touch physics in
 GTK+).
 
 Don't discuss, or link to patents on the developer list. The less we
 know, the less we are likely to infringe, or the less likely we are to
 be condemned for infringing if that were to be the case.
 
 It's the same reason why we don't go scouring patent archives when
 implementing or designing new features.
 
 Cheers
 
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Physically based kinetic scrolling

2014-05-05 Thread Lieven van der Heide
I've created a bugzilla ticked:

https://bugzilla.gnome.org/show_bug.cgi?id=729608

Regards,

Lieven.


On Mon, May 5, 2014 at 2:03 PM, Bastien Nocera had...@hadess.net wrote:

 Hey,

 On Mon, 2014-05-05 at 13:58 +0100, Lieven van der Heide wrote:
  I modified the scrolled windows kinetic scrolling to match the actual
  physics laws for friction and springs. IMHO, this gives a much more
  pleasing result.
 
 
 
  A branch with these changes is at
 
 
  https://github.com/lievenvanderheide/gtk-kineticscrolling
 
 
  I hope that someone can have a look at it, and maybe merge it into the
  main gtk branch.

 Very interesting work. You should create a bug in the GNOME Bugzilla,
 and attached a patch that squashes your 2 commits from your git tree.
 The patch review will be done in Bugzilla instead. You'll at least want
 to add a more detailed commit explaining all the changes you've made.

 Cheers



___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list