5 ms·
This is a pet peeve of mine - why is it that in Linux it's idiomatic to start like 5 processes and pipe their outputs together to find a file containing a cert
by torginus 4y ago
This is a pet peeve of mine - why is it that in Linux it's idiomatic to start like 5 processes and pipe their outputs together to find a file containing a certain word from the shell, but something like a file chooser cannot be its own program?
- usrn 4y agoGNOME often rejects the ideas from the rest of the ecosystem.
- jordemort 4y agoYou'd need some way to inform the window manager that "windows from this process should be considered modals over this window of mine" - probably something that's in the realm of the possible to hack together?
- colejohnson66 4y agoHow do message box (alert) popups work?
- pixelat3d 4y agoin GTK when you instantiate the window you pass what is called the "transient for" property (https://docs.gtk.org/gtk4/method.NativeDialog.set_transient_for.html https://docs.gtk.org/gtk4/method.NativeDialog.set_transient_...). That informs the dialog what it belongs to. If you were to re-engineer this to make the file picker its own process, then you would have to fundamentally change the way it functions, sadly. Edit: And I think Wayland would make this impossible? Someone correct me if I'm wrong here, but don't you lose basically all inter-window introspection with it? There may be some negotiation process, but I don't know how you would go about accessing an entirely separate application's context under that pipeline.
- no_time 4y agoI bet this info isnt written down explicitly except in this comment. The freedesktop.org community really needs it's own Raymond Chen pass down all the accumulated arcane knowledge.
- mlyle 4y ago> I bet this info isnt written down explicitly except in this comment. The comment links to the documentation, which says it explicitly... And then, many other places in the documentation, e.g. https://docs.gtk.org/gtk4/method.Window.set_modal.html https://docs.gtk.org/gtk4/method.Window.set_modal.html > Modal windows prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use gtk_window_set_transient_for() to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent.
- My100thaccount 4y ago> inter-window introspection This oxymoron is a pet peeve of mine. If it's inter-window, then it's just inspection. Introspection is when something inspects itself, but people seem to think it just means inspecting anything technical. Great post though, I just needed to get that off my chest
- OJFord 4y agoMine too! (Perhaps we should introspect each other to determine why we feel this way....) I find it particularly ironic or confusing because introspection seems so much less likely/more rarely to occur in anything technical; so why does it get that association? Because you're right, people do seem to use it as though it means 'highly technical inspection' or something.
- pixelat3d 4y ago
- 4y ago
- XorNot 4y ago"Here are my screen coordinates, I'm going modal while you're running" seems like a perfectly adequate answer to that.
- ginko 4y ago>You'd need some way to inform the window manager that "windows from this process should be considered modals over this window of mine" Why though? Am I the only one that hates modal windows? Why does the parent window have to be blocked by the dialog window? Can't it be like the color picker dialog in GIMP?
- kevingadd 4y agoWhat happens if I hit File->Save, then while the file picker helper process is spawning I get an urgent instant message and tab away, and when I alt-tab back focus returns to GNOME and I close the tab because I forgot I didn't finish saving? Does the file picker go away? If I type a filename in the picker afterward and hit Save, does it save the file even though I closed the tab?
- deepsun 4y agoJust like webpages in browser can capture its closing and ask you if you really want to quit. Same with your proposed workflow, when you try to close the tab, the file picker will pop up again (within the visible area of the tab, not on another monitor), tab stays opened.
- hawski 4y agoAs much as I hate modals they are usually a product of single threaded or poor event loop design.
- bityard 4y agoThere are/were Linux window managers or desktop environments where the file picker was not held if focus above the main window. Or at least they can be configured that way. I know because I've done it. It turns out, that when that happens, the user can accidentally focus the main window while the file picker is up, and then the file picker gets hidden underneath it. As a fun bonus, the application now _probably_ appears to be frozen/crashed because it's waiting for input from the file picker that the user can no longer see. It's just a bad idea, man. For most people anyway.
- account42 4y agoFor X11 there was no need to "hack" that - Window IDs are global so the file chooser just needs to be passed the value to set for its WM_TRANSIENT_FOR property. Wayland might be more difficult since it likes to isolate processes more but considering this should have been common before Wayland was designed it could and should have influenced that design.
- stjohnswarts 4y agoIt's a matter of human resources, gtk3 is an extremely small team compared to its influence.
- kelnos 4y agoHaven't the GTK developers basically admitted that GTK exists to serve the needs of GNOME, and if anyone else gets good use out of it, that's accidental and unsupported? I really wish we had another popular GUI toolkit that isn't Qt.
- account42 4y agoWhy do you need a toolkit different from Qt? Because of the C++ API? Because the licensing (LGPL now so should be good)? Not lean enough for you? Just want something run by the community and no beholden to a single corporate overlord? I'd much rather have one single toolkit standard so that everything can look and behave the same TBH.
- dylan-m 4y ago> … but something like a file chooser cannot be its own program? That's happening! Gtk 3 and 4 include GtkFileChooserNative[1]. It works like a file dialog except the application doesn't know about its widgets. That means it can proxy another application. So if you're running a Gtk app in a sandbox like Flatpak or Snap, Gtk will use the Xdg file chooser portal[2]. In GNOME, this is implemented by an application (in the host) which, itself, creates a GtkFileChooser. In the future, it could be a beefier application. One benefit of that taking a while to happen is, once the implementation gets fancier, there won't be too many weird mismatched applications. (Also, I mention GNOME, but it's important to notice the file chooser portal is itself platform neutral; KDE apps use this, too, and the implementation depends on what desktop you are running. Yay, decoupling!). Not everything uses GtkFileChooserNative, but pretty much any recent Gtk app that doesn't have weird requirements probably does. Off the top of my head, Firefox, Secrets, Bottles, GNOME Builder and GNOME Text Editor (although they still ask for access to all of the of the files for other reasons), … even Slack and VS Code! (Electron switched over recently). [1] https://docs.gtk.org/gtk4/class.FileChooserNative.html https://docs.gtk.org/gtk4/class.FileChooserNative.html [2] https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.FileChooser https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.free...
- dathinab 4y agoWhat I don't understand is why it took so long. That bundling file chooser with a GUI framework is a bad idea should be obvious since well, ... Java Swing?. And a easy to use system interface for a file chooser isn't hard to make, could have been (preferable) a binary you call and communicate with pipes with or similar or could have been something else (e.g. shared object). It's kinda sad that the various Linux communities where so focused on their GUI framework being the best that it didn't happen until it was technically needed (for sandboxing) ... EDIT just to be clear 95+% of applications could use a cmd with Linux style arguments which once done emits the selected file(s) to stdout, but there are a minority of advanced use-cases which require a bit of two way communication. Through most of them are bad ideas anyway, so maybe that could have been ignored.
- dylan-m 4y ago