-
Notifications
You must be signed in to change notification settings - Fork 283
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
Dragable borderless window #214
Comments
As always.. You just have to build a plugin! I took this real-world problem and made a GLFW example plugin. You can find the example under the name draggable_borderless |
This is fantastic, thank you very much! I do want to report that I have implemented it and while it does work, strangely, whenever I grab to drag it, that particular window drops to about 1 fps. Not just the output of the display of the window, but moving the window around my actual screen space. You can see what I mean here https://i.imgur.com/cAKz1EG.gifv From the time I opened it and first move my mouse to the top I am clicking and holding the whole time until the end. It seems that if I move it any sort of decent amount at once it will sit there and wait until I slow down then it pops to place. If I moved it slowly it sort of inches its way along. I don't see any error messages while running the application with just hover run. I am assuming that the performance would be influenced by the complexity of my application? The application isn't really that complex yet. Perhaps I need to figure out how to somehow performance profile my application to see if that is the cause. I am still just learning, so it could very well be from misoptimization in my hierarchy. Regardless of my personal issues, I thank you again for this. It definitely upped the "niceness" of my application. : D |
If you are making sync platform calls, the app will stop rendering frames until the platform calls is completed. |
Hmm... well, technically it shouldn't be making lots of them. I just make one at the start of the app to get data to populate the list of cards on the main screen. That doesn't necessarily mean that it isn't doing more than I think it's doing. I had a pretty strong feeling that the cause was of my own doing. I attempted to introduce the Provider package into my app last night, so there is a good chance I goofed something up along the way. I will have to put a few log messages in there and see if I get repeating calls. Thanks! |
are you using HandleFuncSync or HandleFunc? |
I am using this below, I believe it was just what I found in the demo plugin. func (d *DataPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
channel.HandleFunc(getRemotes, d.getRemotesFunc)
} |
Your app's sluggishness doesn't comes form the platform messages. The issue might come from the the AppBarDraggable plugin while loop, but I don't know how to solve the your particular issue. |
Does the raw https://github.com/go-flutter-desktop/examples/tree/master/draggable_borderless example works for you? (no sluggishness) |
Actually, I just tried it out, it does the same thing. Here are my specs.
[✓] Flutter (Channel beta, v1.7.8+hotfix.4, on Linux, locale en_US.UTF-8) |
I have read: https://stackoverflow.com/questions/46203809/glfw-mouse-event-lag-with-window-drag/46205940#46205940 The author experiences the same issue:
Sorry I cannot help you. 😞 It's up to you to tweak the example to get less stuttering, GLFW how to drag undecorated window |
I understand. I appreciate all you have done so far, it is no problem. |
when I run the example, the error is that:
And the demo can not draggle any more. |
@NetFly-VPN correct, the example abuse GLFW. |
Using HandleFuncSync instead of HandleFunc to ensure the plugin method handler is called from the go-flutter main thread. fixes go-flutter-desktop/go-flutter#214
@NetFly-VPN the draggable_borderless example is now fixed. |
I can not resize the window when setting borderless.Is that possible to remove the header(close widget etc) only? |
@goldenduo have you figured out how to fix this? |
Hey there,
I see there is a borderless window which makes an app look really nice, but then moving it around seems to be a bit difficult. Is there any sort of way built in to have an area at the top in which is still dragable that I might be missing, or is that going to have to be custom within glfw?
Thanks,
-MH
The text was updated successfully, but these errors were encountered: