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

mouse-draggable window margin/padding #3683

Open
rinkjames opened this issue Jun 2, 2021 · 15 comments · May be fixed by #3744
Open

mouse-draggable window margin/padding #3683

rinkjames opened this issue Jun 2, 2021 · 15 comments · May be fixed by #3744

Comments

@rinkjames
Copy link

As far as I can tell this hasn't been covered elsewhere. I've disabled the titlebar using hide_window_decorations titlebar-only in my kitty.conf file, but now I can't move the os_window using my mouse. I do something very similar in atom, but I use a package called no-title-bar to enable 'liberal window dragging' which means I can drag the window from any empty space, like in the below image.

Is something like this possible in kitty, making use of window_margin or window_padding maybe?

dad294de-cd24-11e6-9fee-6e4809cc86a7

@Luflosi
Copy link
Contributor

Luflosi commented Jun 2, 2021

See #84 (comment).

@rinkjames
Copy link
Author

Thanks, I was able to drag it. However, the draggable space with hide_window_decorations titlebar-only is really tiny from what I can tell (see short video). It also sits outside the window and is invisible. I couldn't click the correct area consistently even when focussing on what I'm doing.

So I mainatin that dragging from window margin or window padding would be significantly better UX. Not a viable feature?

Screen.Recording.2021-06-02.at.12.26.40_new2.mov

@rinkjames rinkjames changed the title cannot drag kitty window with hidden titlebar in macOS using mouse mouse-draggable window margin/padding with hidden titlebar in macOS Jun 2, 2021
@rinkjames rinkjames changed the title mouse-draggable window margin/padding with hidden titlebar in macOS mouse-draggable window margin/padding Jun 2, 2021
@Luflosi
Copy link
Contributor

Luflosi commented Jun 2, 2021

I found a way to implement this. I will need to write some code to determine if the drag started in the padding or margin, then it should work. I'll try to implement it this weekend. If I haven't made a PR in two weeks yet, please remind me again.

@kovidgoyal
Copy link
Owner

while I have no objection to implementing dragging from outside margins
(inside margins will probably someday be used to resize windows via
dragging), have you considered simply, not hiding the titlebar, instead
making it the window background color and hiding the buttons.

@rinkjames
Copy link
Author

rinkjames commented Jun 2, 2021

Do you mean using macos_titlebar_color background? Ideally there'd be a solution that doesn't affect background_opacity but I'd be happy with this for my purposes, except how do I hide the buttons?

Edit: seems the tabs display under the titlebar with this solution, but ideally they should be up top as with hide_window_decorations titlebar-only.

@kovidgoyal
Copy link
Owner

maybe I am misremembering, or maybe there was a setting for hiding the
buttons, but then Apple broke it and it was removed.

@rinkjames
Copy link
Author

rinkjames commented Jun 2, 2021

The other thing I just noticed is that even if the buttons were hidden, tabs would display in a row underneath the titlebar. Basically, I'm looking to make my kitty window look like my atom window with tabs at top and with a reasonably-sized mouse-draggable space, e.g. like the window margins or padding etc. See image of windows side-by-side:

Screenshot 2021-06-02 at 13 24 04

@rinkjames
Copy link
Author

I found a way to implement this. I will need to write some code to determine if the drag started in the padding or margin, then it should work. I'll try to implement it this weekend. If I haven't made a PR in two weeks yet, please remind me again.

Hey, how is that PR going?

@towry
Copy link

towry commented Nov 30, 2022

Thanks, I was able to drag it. However, the draggable space with hide_window_decorations titlebar-only is really tiny from what I can tell (see short video). It also sits outside the window and is invisible. I couldn't click the correct area consistently even when focussing on what I'm doing.

So I mainatin that dragging from window margin or window padding would be significantly better UX. Not a viable feature?

Screen.Recording.2021-06-02.at.12.26.40_new2.mov

Off-topic.

Do you mind sharing the conf how to make the kitty looks like in the video? mine is weird like this:

截屏2022-11-30 12 26 13

@jakwings
Copy link

jakwings commented Mar 18, 2023

Could kitty provide any of these:

  1. actions to drag an OS window, sub window or tab

  2. actions to entertoggle dragging mode of OS windows, moved by mouse or keyboard (maybe also showing the current position and size in an overlay)

Option (2) is easier to implement, isn't it?

@thi-marques
Copy link

For Linux users, in Fedora and Ubuntu is possible to drag by clicking in anywhere of the window while holding the Super key.

@raydenz
Copy link

raydenz commented Oct 18, 2023

For Linux users, in Fedora and Ubuntu is possible to drag by clicking in anywhere of the window while holding the Super key.

it works on arch linux thank you
i want to find the shortcut to maximize and reduce the window

@thi-marques
Copy link

For Linux users, in Fedora and Ubuntu is possible to drag by clicking in anywhere of the window while holding the Super key.

it works on arch linux thank you i want to find the shortcut to maximize and reduce the window

In Gnome you can set them whatever you want on:
Settings -> Keyboard -> View and Customize Shortcuts

These are the defaults:

Restore window - Super + down
Maximize window - Super + up
Toggle maximization state - Alt + F10
Resize window - Alt + F8

@PrethamMuthappa
Copy link

For Linux users, in Fedora and Ubuntu is possible to drag by clicking in anywhere of the window while holding the Super key.

Thanks , this seems to work for me :)

@tdarshana
Copy link

You can try this for MacOS -
https://www.reddit.com/r/KittyTerminal/comments/1710di6/comment/k3q5r8q

in brief,
set hide_window_decorations titlebar-only in the kitty.conf.
Run defaults write -g NSWindowShouldDragOnGesture YES
Restart Kitty.
Now you should be able drag the window by holding ctrl+cmd

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

Successfully merging a pull request may close this issue.

9 participants