Window resizing help

Post your Gambas programming questions here.
Post Reply
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Window resizing help

Post by BruceSteers »

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
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Window resizing help

Post by BruceSteers »

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 :)
Attachments
CustomWindow-1.0.4.tar.gz
(13.55 KiB) Downloaded 79 times
If at first you don't succeed , try doing something differently.
BruceS
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Window resizing help

Post by cogier »

I am glad you got it working. Are you using Wayland? I noticed this on the Mailing List.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Window resizing help

Post by BruceSteers »

cogier wrote: Wednesday 21st December 2022 2:39pm I am glad you got it working. Are you using Wayland? I noticed this on the Mailing List.
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-
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.
it's not been fixed yet. (maybe Ben cannot fix it?)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Window resizing help

Post by BruceSteers »

BruceSteers wrote: Wednesday 21st December 2022 3:01pm
cogier wrote: Wednesday 21st December 2022 2:39pm I am glad you got it working. Are you using Wayland? I noticed this on the Mailing List.
No i hate wayland it sucks. i think it needs boycotting for being so rubbish.
Give me MATE any day :)
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 :lol:
If at first you don't succeed , try doing something differently.
BruceS
User avatar
thatbruce
Posts: 161
Joined: Saturday 4th September 2021 11:29pm

Re: Window resizing help

Post by thatbruce »

BruceSteers wrote: Wednesday 21st December 2022 3:01pm
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".
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Window resizing help

Post by BruceSteers »

thatbruce wrote: Thursday 22nd December 2022 11:59am
BruceSteers wrote: Wednesday 21st December 2022 3:01pm No i hate wayland it sucks. i think it needs boycotting for being so rubbish.
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
Haha. "come a little way" , yep that's true :lol: , i think was rolled out way before it was up to the mark, they should have called it way-too-early-land ;)

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
Post Reply