granite icon indicating copy to clipboard operation
granite copied to clipboard

Gtk.Dialog is deprecated

Open Oowoosh0 opened this issue 11 months ago • 3 comments

Gtk.Dialog that Granite.Dialog is subclassing is deprecated since gtk 4.10. So the Granite Dialog should probably directly inherit from Gtk.Window in the future.

Oowoosh0 avatar Mar 19 '25 07:03 Oowoosh0

Changing a base class of an existing class would accidentally break things e.g. failed to build or unexpected visual/behavior change on downstream projects that use Granite. So, we should probably deprecate Granite.Dialog and create a new class like Granite.Window that is based on Gtk.Window.

ryonakano avatar Jun 14 '25 04:06 ryonakano

It would be nice to have a Granite.DialogWindow (say) that reimplements a run () method that pauses the main loop as before. This is useful for dialogs that are launched inside a loop and you want the dialog to finish before the loop continues for example. At the moment I am having to use async methods, with yield andcallback to reproduce this behaviour when the Gtk dialog is called with present (). Or is there a simpler way that would not warrant hiding inside a Granite class?

jeremypw avatar Jun 14 '25 14:06 jeremypw

@jeremypw I don't think we should have dialogs be loop blocking. But instead like FileDialog or Adw have a built-in async method for presenting them

danirabbit avatar Jun 16 '25 22:06 danirabbit