Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to build "standard" dialogs #2368

Open
sclu1034 opened this issue Mar 16, 2023 · 1 comment
Open

Make it possible to build "standard" dialogs #2368

sclu1034 opened this issue Mar 16, 2023 · 1 comment
Labels
architecture changes the architecture, usually breaking

Comments

@sclu1034
Copy link

sclu1034 commented Mar 16, 2023

By "standard", I mean something akin to Gdk.MessageDialog or Gtk.Dialog.

Currently, the two options I see are:

  • WindowLevel::AppWindow, but then the window isn't properly transient for its parent, the parent is not disabled, and _NET_WM_STATE_SKIP_TASKBAR is not available.
  • WindowLevel::Modal, where override redirect is set, fixing most of the points above, but also removing titlebars in the process (and on most window managers the ability to move the window).

Given how common dialogs are, it might be suitable to create a WindowLevel::Dialog(parent) that sets things up akin to Gtk.Dialog.
But ideally, WindowDesc would be given more customizability instead. Especially because you can write something like this right now and wonder why there is no titlebar:

WindowDesc::new(widget)
  // I demand a titlebar
  .set_titlebar(true)
  // But the modal will silently ignore it
  .window_level(WindowLevel::Modal(parent))

So my wishlist to extend a WindowLevel::Modal window description would be:

  • WindowDesc::set_titlebar works
  • titlebar buttons can be toggled (e.g. All/Close/None)
  • WindowDesc::resizable works
  • _NET_WM_STATE_SKIP_TASKBAR/GtkWindow:skip-taskbar-hint can be set
  • GTK_DIALOG_DESTROY_WITH_PARENT can be set
  • override redirect should either not be set or customizable
  • incompatible options (e.g. set_redirect_override(true) + set_titlebar(true)) produce some kind of notice
@sclu1034 sclu1034 changed the title Make it possible to build "standard" dialog Make it possible to build "standard" dialogs Mar 16, 2023
@xStrom xStrom added the architecture changes the architecture, usually breaking label Mar 16, 2023
@xStrom
Copy link
Member

xStrom commented Mar 16, 2023

Generally I think this should indeed be possible and a lot of what you described seems reasonable.

There is the meta issue of Druid being discontinued, so depending on how large the code changes are it might be a very slow review process. One thing I've been thinking about is doing a final push to switch Druid to use Glazier. No promises or ETAs, but in theory this would allow for at least part of the work to be done in the context of Glazier, which would have a lot faster review times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture changes the architecture, usually breaking
Projects
None yet
Development

No branches or pull requests

2 participants