Hey all.
I wrote a routine to resize a window without a titlebar/border
it tracks the mouse and makes the mouse image change okay (needs a better way to set it back to normal though)
Something is not correct though with moving the Left/Top edge and I can't get my head around it.
it seems the (Mouse.X - Mouse.StartX) is jumpy. when moving the left edge the right edge moves a bit and it shouldn't
same with the top edge moving the bottom edge.
has anyone made a cleaner window resizer method?
TIA
Window resizing help
- BruceSteers
- Posts: 1575
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Window resizing help
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- BruceSteers
- Posts: 1575
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Window resizing help
I found a way.
I could not get over the glitch so i worked around it.
Now the window position is noted on a MouseDown event.
then after any Top or Left resize operation the windows Right and Bottom edge are set to the initial noted value in case they have moved.
Seems to work a treat now
PS.
the attached program has a Form.class that if you drop into your application .src folder you will be able to enable the resizing on any Form by setting it's
Form.Borderless property.
handle size can be set with Form.HandleSize property
Happy Christmas
I could not get over the glitch so i worked around it.
Now the window position is noted on a MouseDown event.
then after any Top or Left resize operation the windows Right and Bottom edge are set to the initial noted value in case they have moved.
Seems to work a treat now
PS.
the attached program has a Form.class that if you drop into your application .src folder you will be able to enable the resizing on any Form by setting it's
Form.Borderless property.
handle size can be set with Form.HandleSize property
Happy Christmas
- Attachments
-
- CustomWindow-1.0.4.tar.gz
- (13.55 KiB) Downloaded 89 times
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1126
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Window resizing help
I am glad you got it working. Are you using Wayland? I noticed this on the Mailing List.
- BruceSteers
- Posts: 1575
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Window resizing help
No i hate wayland it sucks. i think it needs boycotting for being so rubbish.
Wayland is glitchy, Ben seems to think top level windows are not movable but they are (maybe the desktop top level window cannot be moved but every application i tried works okay if you do not use gb.gtk3.wayland), or maybe "top-level" refers to "on-top" windows like modals? i dunno
There is just a glitch in gtk3 on wayland but qt and gtk2 work okay with moving windows.
I reported a bug..
https://gambaswiki.org/bugtracker/edit? ... m=L21haW4-
it's not been fixed yet. (maybe Ben cannot fix it?)Bruce on BugTracker wrote: wayland gtk Form position error
With Gtk3 on wayland there are 2 things are quite prevalent.
Form_Move() event does not trigger
My Window position is always X=45, Y=45 even after moving the window.
With QT and gtk2 it works as expected.
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- BruceSteers
- Posts: 1575
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Window resizing help
Give me MATE any dayBruceSteers wrote: ↑Wednesday 21st December 2022 3:01pmNo i hate wayland it sucks. i think it needs boycotting for being so rubbish.
When ubuntu first started the crappy Unity desktop i soon found the old gnome-falback for that old gnome2 traditional desktop environment feel. then MATE got it right
That and Compiz Wobbly windows. if my linux does not have wobbly windows i don't want it
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Window resizing help
No i hate wayland it sucks. i think it needs boycotting for being so rubbish.
[/quote]
Oh that is sooo judgemental! I mean for a rendering protocol mooted in 2008 and started in 2010 because X was "too old" it has certainly come a little way to creating a window manager that these days has almost, but not quite, replaced window rendering with ... well ... nothing.
ymmv
b
Have you ever noticed that software is never advertised using the adjective "spreadable".
- BruceSteers
- Posts: 1575
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Window resizing help
Haha. "come a little way" , yep that's true , i think was rolled out way before it was up to the mark, they should have called it way-too-early-landthatbruce wrote: ↑Thursday 22nd December 2022 11:59amOh that is sooo judgemental! I mean for a rendering protocol mooted in 2008 and started in 2010 because X was "too old" it has certainly come a little way to creating a window manager that these days has almost, but not quite, replaced window rendering with ... well ... nothing.BruceSteers wrote: ↑Wednesday 21st December 2022 3:01pm No i hate wayland it sucks. i think it needs boycotting for being so rubbish.
ymmv
b
What i hate most i think is the way it seems to be restricting gambas.
Certain features gambas has and we know and love are now being met with "but we cannot do that in wayland, meaning gambas can't/won't do it !
But like i've said, i think gambas works pretty much as normal on wayland with gb-qt-wayland and gb-gtk-wayland
I found it's just gb-gtk3-wayland that has window moving issues at present.
If at first you don't succeed , try doing something differently.
BruceS
BruceS