Giter VIP home page Giter VIP logo

Comments (8)

sonnyp avatar sonnyp commented on July 17, 2024 2

A close button is a better solution.

  • Loosing focus by mistake is too easy - in which case you also risk looking the URL/path if it came from a ephemeral source
  • Junction may also loose focus because you want to check something first by alt-tabbing.
  • Or something unexpectedly grabs the focus.

from junction.

sonnyp avatar sonnyp commented on July 17, 2024 2

I have been thinking of making Junction keeping the history of requested locations, in which case I would be open to this being default since closing by accident could be recovered.

I had a look how to do this out of curiosity and unless I'm missing something, it is rather tricky

  window.connect("notify::is-active", () => {
    if (window.is_active) {
      window.close();
    }
  });

On GNOME Shell / wayland ; the window closes when

  • moving it
  • when opening the application menu
  • when opening the window menu (right click on header bar)
  • when opening the entry menu (right click on the resource location)

there is also no way to skip the task bar on GTK4 or Wayland so AFAIK Junction will never really feel like a modal.

There are probably ways to workaround these but unless we want close on blur as standard behavior I don't think it's worth it.

from junction.

robert-sandor avatar robert-sandor commented on July 17, 2024 1

The problem with a close button is that it still requires action from the user. Since the app opens on the middle of the screen, that would make it harder to close than hitting escape, negating the usefulness of it.

I would still argue that having the option to close of focus lost would be good to have, even if it would be an opt-in option, instead of being the default. Maybe with an on-window option to keep it open on a per-window basis, if losing an ephemeral sourced URL is a concern.

from junction.

sonnyp avatar sonnyp commented on July 17, 2024

Loosing focus also requires an action from the user right?

I concede that it's slightly harder to press the close button but

  1. it's familiar and unsurprising
  2. if Junction popups it's likely in response to user action so dismissing Junction is less of a concern

Do you have a special use case for this feature that I may not be thinking of?

from junction.

robert-sandor avatar robert-sandor commented on July 17, 2024

I guess this comes out more from how i use the application - for myself, this works as a browser selector per link that i click.
Hence i expect it to act more like a pop-up, than a full-fledged application - meaning that if focus is lost to it, it goes away. That's the expectation i have based on my use-case.

I recognize that i am not everyone, hence was considering whether adding the option to do so, even if not enabled by default would bring value to the app.

from junction.

sonnyp avatar sonnyp commented on July 17, 2024

Ok, I also use it the same way but don't feel the need for this.

Anyway, feel free to send a PR, should be quite simple

You want to do something like (pseudo code ahead)

in window.js when window object looses focus, call action win.close (or directly method window.close)

Once you have that - you can put it behind a setting by using https://docs.gtk.org/gio/class.Settings.html

We don't have a preferences window yet and I'm not sure I want this to have UI anyway but users can use dconf or gsettings CLI to set/unset this

Happy to help

from junction.

sonnyp avatar sonnyp commented on July 17, 2024

see https://github.com/sonnyp/Junction#development

from junction.

defini-tiv avatar defini-tiv commented on July 17, 2024

sad.
I think it would be the most intuitive option since e.g. the android dialogues behave the same.
It is definetly a flaw of gtk4 (or wayland) that such a usecase is not thought of.
So there should be comunicated somehow i guess...

from junction.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.