GtkPaned: ghost handle intercepts mouse clicks
Steps to reproduce
- create a GtkPaned with clickable start child
- remember the handle position
- hide the end child (
gtk_widget_set_visible(FALSE)
) - click on where the handle was located
Current behavior
The handle left a ghost behind that catches click events.
Expected outcome
The click events reach the start child.
Version information
- Gtk 4.14-rc + ea0cfed7, self-build (debug mode), windows10 msys2-ucrt64
- Gtk 4.12.4, release build, X11 Cinnamon
Additional information
Little Python snippet for playing:
import sys
import gi
gi.require_version('Gtk', '4.0')
from gi.repository import GObject, Gtk
class MyApp(Gtk.Application):
def __init__(self):
Gtk.Application.__init__(self)
self.connect('activate', self.on_activate)
def on_activate(self, app):
self.add_window(MyAppWindow())
class MyAppWindow(Gtk.ApplicationWindow):
def __init__(self):
super().__init__(default_width=400, default_height=600, show_menubar=False)
textview = Gtk.TextView()
textview.get_buffer().set_text("\n".join([f"{n} Lorem ipsum dolor sit amet, consectetur adipiscing elit." for n in range(100)]))
scroll = Gtk.ScrolledWindow()
scroll.set_child(textview)
label = Gtk.Label.new("Hide me!")
paned = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL, start_child=scroll, end_child=label, position=300)
self.set_child(paned)
button = Gtk.ToggleButton.new_with_label("Hide bottom")
button.set_focus_on_click(False)
button.bind_property('active', label, 'visible', GObject.BindingFlags.INVERT_BOOLEAN | GObject.BindingFlags.SYNC_CREATE)
headerbar = Gtk.HeaderBar(show_title_buttons=True)
headerbar.pack_start(button)
self.set_titlebar(headerbar)
self.present()
if __name__ == '__main__':
sys.exit(MyApp().run(sys.argv))
After hiding the bottom pane, the line 17 can't be clicked...
.