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

Setting fixed size on MainWindow makes the window undraggable. macOS. Qt 5.14.2 #45

Open
956MB opened this issue Jun 14, 2020 · 1 comment

Comments

@956MB
Copy link

956MB commented Jun 14, 2020

Using the CFramelessWindow in my project, if I try to set a fixed window size or set the maximum window size at all, I can no longer move the window.

Can be recreated by opening a new project, importing the framelesswindow.h, framelesswindow.cpp, and framelesswindow.mm, then setting CFramelessWindow, then try either setting maximum window size in designer, or use something like setFixedSize(w,h).

@956MB
Copy link
Author

956MB commented Jun 15, 2020

So something I noticed is that if you are trying to set the window a fixed size, and you cant move it anymore, you can change the line in 'framelesswindow.mm':

[window setMovable:NO]; to [window setMovable:YES];

...the window becomes movable again, however, only movable by the slight 20px height of the original macOS titlebar that was there. Which if youre using a frameless window, is a little small.

On the other hand, if you uncomment the line in 'framelesswindow.mm':

window.movableByWindowBackground = YES;

...the window is now movable with a larger drag area, but with two draw backs.

  1. It seems like you can no longer set a specific drag area for the window. The window continues to have an 'm_draggableHeight' of 0 (the whole window).
  2. It also seems like now the window is draggable on top of buttons and labels, where it wasnt previously.

So. If this has already been an enstablished fact here, I appologize, I just figured it out. And if im missing something like a fix to the drag area thing in the second solution there, lmk. Also, I have not looked into this "problem", or for a "solution" in the windows 'framelesswindow.cpp', but I assume thered be an equivalent fix.

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

No branches or pull requests

1 participant