Recent

Author Topic: 32-bit GTK2 - borderless form is jumpy when moving by mouse  (Read 2323 times)

edvard

  • Full Member
  • ***
  • Posts: 165
32-bit GTK2 - borderless form is jumpy when moving by mouse
« on: February 26, 2015, 08:19:44 am »
I have a borderless form that is movable by mouse-grabbing a panel.
Relevant code here:

Code: [Select]
var
  MPos: Tpoint;

{ If mouse clicks on the top bar, grab the mouse position... }
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  MPos.X := X;
  MPos.Y := Y;
end;

{ ... and if mouse moves while clicked on the top, change the co-ords of the
  Window to follow mouse. This way we can move the window without a title bar. }
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if ssLeft in Shift then
    SetBounds(Left + (X - MPos.X), Top + (Y - MPos.Y), Width, Height);
end;

In Windows, Qt 32 and 64 bit, and 64 bit GTK2, the window move smoothly as you drag it.  In 32-bit GTK2 specifically, moving the window with the mouse causes the window to jump around the desktop spasmodically, sometimes ending up off the screen with just a corner showing.
Any ideas?
All children left unattended will be given a mocha and a puppy.

Debian 'Testing' 64-bit | Xfce 4.12 | FreePascal 3.0 + Lazarus 1.6.2, GTK2+ and Qt

Eugene Loza

  • Hero Member
  • *****
  • Posts: 563
    • My "almost daily" development blog
Re: 32-bit GTK2 - borderless form is jumpy when moving by mouse
« Reply #1 on: February 26, 2015, 09:51:18 am »
Confirm. Had the same issue while looking for solution for not-resizable forms...
Lazarus 1.9 + FPC 3.1.1 Debian Jessie 64 bit.

My Free and Open Source games in Lazarus/FreePascal/CastleGameEngine:
https://decoherence.itch.io/
(and some ancient games in Turbo Pascal too)
Sources are here: https://github.com/eugeneloza?tab=repositories