Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-05

GTK3, OnKeyDown

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

Strange. With LCL-GTK3 a Form.OnKeyDown handler is not called. The test app from issue :
https://bugs.freepascal.org/view.php?id=37073
can be used. It has a splashscreen but have tested with a normal form, too. Same effect.

The attached patch takes out a test

  if Widget^.has_focus then

in function Gtk3WidgetEvent(). Then an OnKeyDown handler is called twice. Strangely enough, debugger shows the following line

  Result := TGtk3Widget(Data).GtkEventKey(Widget, Event, True);

is called at least sometimes even when the Widget^.has_focus test is there. The message is delivered somewhere but not to the form. GTK3 experts, do you know what is going on?

Juha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-LCL-GTK3-Make-TForm.OnKeyDown-work.patch Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200516/61f215ad/attachment-0001.bin>

Reply by email