lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.28k stars 161 forks source link

Show Tilda on mouse cursor monitor #253

Open weyfonk opened 8 years ago

weyfonk commented 8 years ago

This is a possible solution for #219. It is obviously not ideal, as it uses deprecated functions (gdk_display_get_device_manager() and gdk_device_manager_get_client_pointer()) so if someone knows of a possible better solution, please let me know and I'll gladly improve this code.

GladOSkar commented 7 years ago

As far as i can see this does not support animations. Are you still behind this? If not, i will give it a try.

phwelo commented 6 years ago

ftr, this feature would improve my workflow a bunch.

confluence commented 4 years ago

What is the status of this patch?

byteSamurai commented 4 years ago

hey @lanoxx, thx for all your work! Tilda is my personal favorite terminal.

Is there anything I can do to bring this feature in? Also: I would be very happy to see a new release as the last one happend almost 2 years ago.

lanoxx commented 4 years ago

Next release should happen early Feb. just in time before the Ubuntu 20.04 freeze.

I will try to take a look at this patch before the release.

lanoxx commented 4 years ago

I spend quite some time to look at this patch today. I have rebased it and you can find it in the branch wip/show-on-mouse-screen. However, there is one major issue with this solution. The current code assumes in a lot of places that the configured monitor is also the current monitor where tilda is shown. This patch changes that assumption, because the window can now appear on a monitor different from the configured one. The result is that many places in the code that somehow affect the window position need to be changed to take into consideration that the tilda window is not on the monitor that has been configured.

byteSamurai commented 4 years ago

The current code assumes in a lot of places that the configured monitor is also the current monitor where tilda is shown.

If I get your right something like a MonitorController could help here right? To hide the assumed logic and the change of state within a controlled space. yay? nay?

Otherwise I would try to be brave, polish my C-skills and try to bring up an approach. (Which could take some time because I have not written C for almost 8 years :sweat_smile: )

Of course only if @weyfonk won't be faster

lanoxx commented 4 years ago

For the 1.5 release thats not needed, if anyone can test my branch and confirm that it works for you as expected, then I am willing to merge it. For the next release the code will certainly have to be cleaned up. The tilda_window should probably cache a few values and use them for its computations, rather then fetching all values from the config system each time.

In the future we probably want a separation of the configuration mechanism. Currently we have config_get* calls everywhere in the code, which is really bad. There should be a configuration object that gets populated when tilda is loaded from the configuration file and that object should be passed around inside tilda. That would also allow us to make the CLI options transient, whereas right now CLI options overwrite the values in the config file.

If you want to work on something feel free to ask me in an issue or open a pull request. I am happy to help if there are questions on the code.

lanoxx commented 4 years ago

Did you have time to test the code?

byteSamurai commented 4 years ago

I will try to test it the next days. Will write here afterwards 😊

lanoxx commented 4 years ago

That would be great. I want to release tilda 1.5 on Friday if possible. If I get feedback before that and there are no major issues I can include it in the release.

byteSamurai commented 4 years ago

hey @lanoxx,

tested it with this settings:

image

Unfortunatelly its not working :unamused:

(Would send you a screen record, but my employer wants me to use Centos 8 as workstation, therefore my repositories are a bit "empty". Sry)

I opened tilda and tried several times to open close it via F1 button, but Tilda does not care where the mouse is. It only show up on the main screen. I think its better to skip it for v1.5

lanoxx commented 4 years ago

@byteSamurai are few questions:

  1. I assume you are on an X11 seession and not on wayland, but just to make sure, can you confirm that you are indeed on X11.
  2. Which desktop environment are you using? Is it Gnome 3 with Gnome Shell or something else?
lanoxx commented 4 years ago

It looks like the centered horizontally option is the problem. Please disable that and try again. I will check how I can resolve that.

byteSamurai commented 4 years ago

My fault and both correct: Xorg with Gnome 3. Almost default CentOS 8 Installation

lanoxx commented 4 years ago

Getting this feature right with all the different config options that tilda supports is actually quite tricky. For example, we need to consider the "Non-Focus Terminal Behavior" option, the monitor size updates, the fact that the monitor where the mouse is on might have a different size than the monitor where the tilda window was before, just to name a few.

With a fullsize window (both height and width set to 100%) and two equally sized monitors the feature works reasonably well for me. But getting all those edge cases right is a bit more work.

KristjanTammekivi commented 3 years ago

Any news on this?

lanoxx commented 3 years ago

Unfortunately I have not had time to work on this. I started with a few changes on a separate branch to make the config system more flexible, but its not yet in a state where I am happy with the result. That would be a prerequisite to continue on this feature.

byteSamurai commented 3 years ago

I am not using Linux anymore: Started my PhD in a big concern. MacOS is the next best thing I can use at the moment. Sorry 😢

lanoxx commented 3 years ago

No worries. Good luck with your Phd.