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

Show Tilda on mouse cursor monitor #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

weyfonk
Copy link
Contributor

@weyfonk weyfonk commented Aug 23, 2016

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.

@weyfonk weyfonk closed this Jan 19, 2017
@weyfonk weyfonk deleted the show-on-mouse-screen branch January 19, 2017 23:12
@weyfonk weyfonk restored the show-on-mouse-screen branch January 19, 2017 23:27
@weyfonk weyfonk reopened this Jan 19, 2017
@GladOSkar
Copy link
Contributor

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
Copy link

phwelo commented Dec 14, 2017

ftr, this feature would improve my workflow a bunch.

lanoxx
lanoxx previously requested changes May 31, 2018
src/key_grabber.c Outdated Show resolved Hide resolved
src/key_grabber.c Outdated Show resolved Hide resolved
src/key_grabber.c Outdated Show resolved Hide resolved
Tilda can now be configured to appear on whichever monitor the mouse
cursor is currently located. This option is disabled by default.
@weyfonk weyfonk force-pushed the show-on-mouse-screen branch from 1894fd0 to f8e4410 Compare June 12, 2018 08:54
@confluence
Copy link

What is the status of this patch?

@byteSamurai
Copy link

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
Copy link
Owner

lanoxx commented Jan 29, 2020

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
Copy link
Owner

lanoxx commented Feb 2, 2020

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.

@lanoxx lanoxx added this to the 1.5 milestone Feb 2, 2020
@byteSamurai
Copy link

byteSamurai commented Feb 2, 2020

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 😅 )

Of course only if @weyfonk won't be faster

@lanoxx
Copy link
Owner

lanoxx commented Feb 2, 2020

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
Copy link
Owner

lanoxx commented Feb 4, 2020

Did you have time to test the code?

@byteSamurai
Copy link

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

@lanoxx
Copy link
Owner

lanoxx commented Feb 4, 2020

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
Copy link

hey @lanoxx,

tested it with this settings:

image

Unfortunatelly its not working 😒

(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
Copy link
Owner

lanoxx commented Feb 5, 2020

@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
Copy link
Owner

lanoxx commented Feb 5, 2020

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
Copy link

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

@lanoxx
Copy link
Owner

lanoxx commented Feb 5, 2020

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.

@lanoxx lanoxx dismissed their stale review February 6, 2020 19:24

Superseeded by wip/show-on-mouse-screen

@lanoxx lanoxx modified the milestones: 1.5, 2.0 May 2, 2020
@KristjanTammekivi
Copy link

Any news on this?

@lanoxx
Copy link
Owner

lanoxx commented Jul 29, 2021

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
Copy link

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
Copy link
Owner

lanoxx commented Jul 30, 2021

No worries. Good luck with your Phd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants