gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
https://gtk-rs.org/
MIT License
1.24k stars 82 forks source link

Add gtk::Socket and gtk::Plug subclassing support #994

Closed kinnison closed 4 years ago

kinnison commented 4 years ago

The Socket class only has two additional signals over a container, so it's a pretty trivial subclass.

Signed-off-by: Daniel Silverstone dsilvers@digital-scurf.org

kinnison commented 4 years ago

I believe there's no reason this shouldn't be safe, but it's my first ever subclass and all I did was make sure things looked sane and didn't have compile errors.

kinnison commented 4 years ago

Aah, I need to detect if X11 is present in gtk for this to be cross-platform safe. Hmm. Any suggestions?

sdroege commented 4 years ago

Aah, I need to detect if X11 is present in gtk for this to be cross-platform safe. Hmm. Any suggestions?

See https://github.com/gtk-rs/gtk/blob/master/src/auto/mod.rs#L1334 . Which is of course also very wrong: macOS and Windows also have X11 implementations and not every Unix has one. I think this needs a custom X11 feature flag.

kinnison commented 4 years ago

I suppose nominally I ought to write the GtkPlug subclass support too, shall I do that, similarly guarded, and then we could merge those while we think about a better way to guard the X11 stuff?

kinnison commented 4 years ago

Depending on the opinion of people on https://github.com/gtk-rs/gtk/pull/995 we may want to hold off merging this until a better config label can be used.

sdroege commented 4 years ago

@GuillaumeGomez CI is green