linebender / linebender/druid

Make it possible to build "standard" dialogs

Open
#2,368 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

architecture
Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

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:

```rust
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with WindowDesc and WindowLevel::Modal, then trace how the listed window options are handled. Compare the current behavior with the requested standard-dialog behavior, including titlebars, buttons, resizability, taskbar hints, parent destruction, and override redirect. Done means the API behavior and incompatibility notices are defined and the requested dialog capabilities work together.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.