TabFern icon indicating copy to clipboard operation
TabFern copied to clipboard

add option to define position, size and offset of new windows (not specific to which window it is)

Open andr222 opened this issue 5 years ago • 7 comments

Currently opening a new window in tabfern seems to use the position and size of the last window closed, with an offset. If the last window closed had an unusual position or size, the new window will open at that usual and likely unwanted position and size, with an offset. (Issue #18 gives a workaround to correct a weird position and size, but always gives an offset on new windows) By explicitly defining the preferred position, size, and offset, unwanted locations are readily avoided.

In my case it would be preferred that all windows open in exactly the same position and size, with no offset. Excepting of course the tabfern window, which if always left open, will guard its' position and size. Users generally have one or more bars listing open applications, which allows switching between overlaid open windows, as well as using the tabfern window.

My system : Mageia (Linux) with Maté desktop. Such an option should work with all graphic systems, including Linux, MsWindows, and Apple ios.

It might be preferable to add this option in the Chromium code, but failing that, putting it in tabfern would fully satisfy my needs.

andr222 avatar Aug 13 '19 00:08 andr222

Thanks! I don't have any Chromium development experience, but I think this is reasonably within scope for TF (or a plug-in, once the TF plug-in system is designed and implemented).

cxw42 avatar Aug 13 '19 02:08 cxw42

I made a stab at the window size & position problem. My approach was to create two separate controls in settings/behaviour tab.

  1. window size preference with a simple text field that will force all normal windows to resize themselves upon creation to the user defined size.
  2. window position preference again with simple text field. The text field is validated with regex and follows the format of 2 numbers separated with ':' character and optionally having a + in front of the numbers. E.g. +22:+22 or 50:50 The '+'-ed version is going to apply the values as an x,y offset to the previously focused window (tabfern pop window is excluded I think) The non-'+'-ed format is a fixed position on the screen where the top left corner of the window will be.

I also tried to look into adding an option where the last recently used window's size would be the default new window position, but I couldn't come up with a good reliable solution. Note, that with the #18 workaround works with the my offset feature. If you disable the fixed window size and enable only the window position offset and set it to +0:+0 then the next window with open exactly on top of the most recently focused window.

Let me know if you have any comments or questions...

csabag avatar Aug 07 '20 10:08 csabag

@csabag Thanks for the work and PR! I'll take a look!

cxw42 avatar Aug 14 '20 13:08 cxw42

@csabag Your approach looks good. It should accomodate a variety of preferences. Hopefully it does indeed exclude the tabfern popup window. Thanks for your work :)

andr222 avatar Aug 15 '20 01:08 andr222

mis-click. Didn't mean to close issue

andr222 avatar Aug 15 '20 01:08 andr222

That'd be great.

I've been using WindowManager to handle windows placements. It doesn't work for multiple windows of the same browser, because they all use the same program exe and their title is current tab's title.

It'd be awesome if TabFern was able to place its remembered windows on their proper position and size, which would need to be set. In that case, don't forget multi monitor and negative positions!

An even better solution is to set each window's title as its TabFern name. I have no idea if chromium allows extensions to set windows titles. If that's possible, then WindowManager would be able to find each of them and place them accordingly.

HikariWS avatar Nov 03 '20 20:11 HikariWS

@HikariWS Do you mean saving and restoring each window's position and size individually? If so, please open a new issue for that (I don't see one open already). Thanks!

cxw42 avatar Dec 18 '20 13:12 cxw42