The rich text sample works if you build with --with-gtk=2.
However, if you look at the wxStyleTextCtrl (stc) example, you'll notice it implements the menu differently. The rich text sample has a frame with an "Edit" menu that has the right ids (wxID_COPY...) and labels, but no corresponding event table/handlers, and relies instead on a generic ProccessEvent handler that forwards (with a recursion check) the event to the currently focused descendant window of the frame. The stc example actually has a main window event table that connects the "Edit" menu items to a single, generic handler that forwards the event directly to the stc widget. This also obviates the need for a recursion check, like in ProcessEvent (for example, if the focused window doesn't handle EVT_MENU(wxID_COPY...), it will bubble back up to ProcessEvent when forwarded, but the stc handles all of the relevant frame "Edit" menu events).
So I figured, maybe that's how to fix it? Certainly, in my testing, this makes everything work on Gtk2. But unfortunately, when I tried this with gtk3, wxFindFocusDescendant(), and even FindFocus(), don't seem to work. They work with gtk2, but for some reason, in my experiment, they always return null.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
It's really strange that this bug depends on the GTK version, wxRTC code should normally be platform-independent and even if there are other ways to make it work, it would be nice to understand why the current code doesn't work with GTK 3 if it works with GTK 2.
BTW, when you say "no longer", does it mean that it worked with GTK 3 before? If so, do you have at least a rough idea of when did it work?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
It's really strange that this bug depends on the GTK version, wxRTC code should normally be platform-independent and even if there are other ways to make it work, it would be nice to understand why the current code doesn't work with GTK 3 if it works with GTK 2.
It has to do with event handling, not rtc specifically.
The easiest way I could see to make it work, in theory, is rewrite it to be more like the stc example (where instead of an "Edit" menu with null handlers that relies on a ProcessEvent implementation that forwards to the focused window, you define a generic handler that you map to each "Edit" menu item, and it forwards those events). However, in the stc example, the frame maintains a reference to the stc widget, and forwards only to it, whereas, you would like the frame "Edit" menu to work for any descendant window that supports Cut/Copy/Paste actions (for example, a spin ctrl used to set font size), which would mean using some kind of wxFindFocusDescendant()/FindFocus()--and this approach works fine with gtk2, but with gtk3, wxFindFocusDescendant()/FindFocus() always return null.
BTW, when you say "no longer", does it mean that it worked with GTK 3 before? If so, do you have at least a rough idea of when did it work?
No, I just meant it worked sometime in the past (for example, with Gtk2).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
It has to do with event handling, not rtc specifically.
If this is true, I'd strongly prefer to find the discrepancy between the events generated with GTK 2 and GTK 3 (and/or other ports) and fix this rather than working around it in either wxRTC or the sample.
Would you have any idea about what the difference is between GTK 2 and GTK 3 here?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Would you have any idea about what the difference is between GTK 2 and GTK 3 here?
No, sorry, I'm new to wxWidgets and Gtk development.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Amazingly, this seems to be Wayland-specific: the menu items work fine for me with GDK_BACKEND=x11 but not without it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
This is due to focus not being on the rich text control when the menu item is activated when using Wayland. This might be a problem for other code too as I think it's not uncommon to do something with the focused window from a menu event handler. But I am not sure we can really do anything about this, we just get a "focus_out" notification when the menu is clicked and nothing else. Could we remember the old focus and pretend that it's valid while the menu is opened perhaps?
For now, I'll just fix the hack in the sample but we'll probably hear about this problem again in the future.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()