[Git][wxwidgets/wxwidgets][master] 12 commits: Fix incorrectly named parameters in angle-changed callback in wxGTK

2 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Feb 26, 2026, 9:01:52 AM (11 days ago) Feb 26
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 5f8b8dda
    by Filip Hejsek at 2026-02-24T20:35:03+01:00
    Fix incorrectly named parameters in angle-changed callback in wxGTK
    
  • f0096773
    by Filip Hejsek at 2026-02-24T20:48:37+01:00
    Move global gesture variables in wxGTK into wxWindowGesturesData
    
    Also rename them to make it clear which gesture they belong to.
    
    This fixes issues when a gesture is active in different windows at the
    same time.
    
  • 737c5337
    by Filip Hejsek at 2026-02-24T20:48:39+01:00
    Fix rotate gesture start callback not setting last angle in wxGTK
    
  • e8bf4b6b
    by Filip Hejsek at 2026-02-24T20:54:30+01:00
    Fix spurious GestureEnd events from cancel signal in wxGTK
    
    Use the existing m_activeGestures field to track which GTK gestures
    are active, and check whether a gesture is active before dispatching
    GestureEnd events.
    
    Also replace m_panGestureStart by checking if the gesture wasn't active.
    
    Closes #26211.
    
  • 6062bda2
    by ali kettab at 2026-02-26T00:20:38+01:00
    wxQt: Fix wxWindow::SetClientSize() when called for a TLW
    
  • 05212d5c
    by ali kettab at 2026-02-26T00:25:00+01:00
    wxQt: Fix wxCheckBox control creation
    
    Essentially, don't pass an invalid _style_ to wxCheckBoxBase::Create().
    Also, get rid of that old comment that's no longer true.
    
  • 014fe8c1
    by Scott Talbert at 2026-02-25T19:35:49-05:00
    Enable building wxQt with Qt6 with autoconf
    
    This already works with cmake.
    
  • 0a178955
    by Scott Talbert at 2026-02-25T19:35:53-05:00
    Document how to use autoconf container on Fedora
    
  • 8ed14697
    by Alex Shvartzkop at 2026-02-26T14:49:05+01:00
    Fix crash on wxGLCanvasEGL destruction
    
    The "unmap" signal handler was called from wxWindow dtor and accessed
    the already destroyed wxGLCanvasEGL object, resulting in a crash.
    
    Avoid this by disconnecting this handler when the object is being
    destroyed.
    
    Closes #26248.
    
  • 19f7bbb0
    by Vadim Zeitlin at 2026-02-26T14:57:15+01:00
    Merge branch 'gtk_gesture_fixes' of github.com:filip-hejsek/wxWidgets
    
    Fix multiple problems in wxGTK gestures handling: previously, gesture
    cancellation could result in spurious gesture end events. Another issue
    was that gesture handling used several global variables, even though
    there could be multiple independent gestures of the same type active in
    different windows.
    
    See #26241.
    
  • 62f62411
    by Vadim Zeitlin at 2026-02-26T14:59:43+01:00
    Merge branch 'qt6_autoconf' of github.com:swt2c/wxWidgets
    
    Enable building wxQt with Qt6 with autoconf too (and not only CMake).
    
    See #26245.
    
  • 926af1cc
    by Vadim Zeitlin at 2026-02-26T15:00:17+01:00
    Merge branch 'qt-fixes' of github.com:AliKet/wxWidgets
    
    Miscellaneous wxQt fixes.
    
    See #26246.
    

7 changed files:

Changes:

  • build/tools/autoconf/README.md
    ... ... @@ -18,12 +18,18 @@ directly by executing the following command from the top-level wx directory:
    18 18
     $ podman run -v `pwd`:/wx --rm docker.io/vadz/autoconf-for-wx
    
    19 19
     ```
    
    20 20
     
    
    21
    -or, if you prefer to use podman:
    
    21
    +or, if you prefer to use docker:
    
    22 22
     
    
    23 23
     ```shell
    
    24 24
     $ docker run -v `pwd`:/wx --rm vadz/autoconf-for-wx
    
    25 25
     ```
    
    26 26
     
    
    27
    +If using Fedora (or other system with SELinux enabled), you might need to add an option to relabel the volume content:
    
    28
    +
    
    29
    +```shell
    
    30
    +$ podman run -v `pwd`:/wx:Z --rm docker.io/vadz/autoconf-for-wx
    
    31
    +```
    
    32
    +
    
    27 33
     
    
    28 34
     ## Build
    
    29 35
     
    

  • configure
    No preview for this file type
  • configure.ac
    ... ... @@ -3303,18 +3303,31 @@ installed, where VER is 2, 3 or 4.
    3303 3303
                 AC_MSG_ERROR([specify QT5_CUSTOM_DIR or make sure pkg-config is available to search for Qt5 libraries])
    
    3304 3304
     
    
    3305 3305
             else
    
    3306
    -            PKG_CHECK_MODULES(QT5,
    
    3307
    -                          [Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test Qt5PrintSupport],
    
    3306
    +            PKG_CHECK_MODULES(QT6,
    
    3307
    +                          [Qt6Core Qt6Widgets Qt6Gui Qt6OpenGL Qt6OpenGLWidgets Qt6Test Qt6PrintSupport],
    
    3308 3308
                     [
    
    3309
    -                TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}"
    
    3310
    -                GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
    
    3311
    -                if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
    
    3309
    +                TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT6_CFLAGS}"
    
    3310
    +                GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT6_LIBS}"
    
    3311
    +                if `pkg-config --variable qt_config Qt6Core | grep "reduce_relocations" >/dev/null`; then
    
    3312 3312
                         dnl build with position independent code if Qt needs it
    
    3313 3313
                         wxUSE_PIC=yes
    
    3314 3314
                     fi
    
    3315 3315
                     ],
    
    3316 3316
                     [
    
    3317
    -                    AC_MSG_ERROR([Qt5 libraries are not available])
    
    3317
    +                    PKG_CHECK_MODULES(QT5,
    
    3318
    +                                  [Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test Qt5PrintSupport],
    
    3319
    +                        [
    
    3320
    +                        TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}"
    
    3321
    +                        GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
    
    3322
    +                        if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
    
    3323
    +                            dnl build with position independent code if Qt needs it
    
    3324
    +                            wxUSE_PIC=yes
    
    3325
    +                        fi
    
    3326
    +                        ],
    
    3327
    +                        [
    
    3328
    +                            AC_MSG_ERROR([Neither Qt6 nor Qt5 libraries are available])
    
    3329
    +                        ]
    
    3330
    +                    )
    
    3318 3331
                     ]
    
    3319 3332
                 )
    
    3320 3333
             fi
    

  • src/gtk/window.cpp
    ... ... @@ -402,6 +402,10 @@ public:
    402 402
         wxPoint              m_lastTouchPoint;
    
    403 403
         GdkEventSequence*    m_touchSequence;
    
    404 404
         bool                 m_rawTouchEvents;
    
    405
    +    double               m_lastPanOffset;    // Last offset for the pan gesture, used to calculate deltas for pan gesture event
    
    406
    +    gdouble              m_lastScale;        // Last scale provided by GTK, used when zoom gesture ends
    
    407
    +    gdouble              m_lastAngleDelta;   // Last angle provided by GTK, used when rotate gesture ends
    
    408
    +    wxPoint              m_lastGesturePoint; // Last zoom/rotate gesture point
    
    405 409
     
    
    406 410
         GtkGesture* m_vertical_pan_gesture;
    
    407 411
         GtkGesture* m_horizontal_pan_gesture;
    
    ... ... @@ -418,21 +422,6 @@ typedef wxExternalField<wxWindow,
    418 422
     
    
    419 423
     } // anonymous namespace
    
    420 424
     
    
    421
    -// This is true when the gesture has just started (currently used for pan gesture only)
    
    422
    -static bool gs_gestureStart = false;
    
    423
    -
    
    424
    -// Last offset for the pan gesture, this is used to calculate deltas for pan gesture event
    
    425
    -static double gs_lastOffset = 0;
    
    426
    -
    
    427
    -// Last scale provided by GTK
    
    428
    -static gdouble gs_lastScale = 1.0;
    
    429
    -
    
    430
    -// This is used to set the angle when rotate gesture ends.
    
    431
    -static gdouble gs_lastAngle = 0;
    
    432
    -
    
    433
    -// Last Zoom/Rotate gesture point
    
    434
    -static wxPoint gs_lastGesturePoint;
    
    435
    -
    
    436 425
     #endif // wxGTK_HAS_GESTURES_SUPPORT
    
    437 426
     
    
    438 427
     //-----------------------------------------------------------------------------
    
    ... ... @@ -3351,25 +3340,16 @@ enum GestureStates
    3351 3340
         end
    
    3352 3341
     };
    
    3353 3342
     
    
    3354
    -enum TrackedGestures
    
    3343
    +enum TrackedGesture
    
    3355 3344
     {
    
    3356 3345
         two_finger_tap = 0x0001,
    
    3357 3346
         press_and_tap  = 0x0002,
    
    3358 3347
         horizontal_pan = 0x0004,
    
    3359
    -    vertical_pan   = 0x0008
    
    3348
    +    vertical_pan   = 0x0008,
    
    3349
    +    rotate         = 0x0010,
    
    3350
    +    zoom           = 0x0020,
    
    3360 3351
     };
    
    3361 3352
     
    
    3362
    -extern "C" {
    
    3363
    -static void
    
    3364
    -pan_gesture_begin_callback(GtkGesture* WXUNUSED(gesture), GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* WXUNUSED(win))
    
    3365
    -{
    
    3366
    -    gs_gestureStart = true;
    
    3367
    -
    
    3368
    -    // Set it to 0, as this will be used to calculate the deltas for new pan gesture
    
    3369
    -    gs_lastOffset = 0;
    
    3370
    -}
    
    3371
    -}
    
    3372
    -
    
    3373 3353
     extern "C" {
    
    3374 3354
     static void
    
    3375 3355
     horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequence, wxWindow* win)
    
    ... ... @@ -3378,8 +3358,8 @@ horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* seque
    3378 3358
         if ( !data )
    
    3379 3359
             return;
    
    3380 3360
     
    
    3381
    -    // Do not process horizontal pan, if there was no "pan" signal for it.
    
    3382
    -    if ( !(data->m_allowedGestures & horizontal_pan) )
    
    3361
    +    // Ignore the signal if the gesture isn't active
    
    3362
    +    if ( !(data->m_activeGestures & horizontal_pan) )
    
    3383 3363
         {
    
    3384 3364
             return;
    
    3385 3365
         }
    
    ... ... @@ -3391,14 +3371,14 @@ horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* seque
    3391 3371
             return;
    
    3392 3372
         }
    
    3393 3373
     
    
    3394
    -    data->m_allowedGestures &= ~horizontal_pan;
    
    3395
    -
    
    3396 3374
         wxPanGestureEvent event(win->GetId());
    
    3397 3375
     
    
    3398 3376
         event.SetEventObject(win);
    
    3399 3377
         event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
    
    3400 3378
         event.SetGestureEnd();
    
    3401 3379
     
    
    3380
    +    data->m_activeGestures &= ~horizontal_pan;
    
    3381
    +
    
    3402 3382
         win->GTKProcessEvent(event);
    
    3403 3383
     }
    
    3404 3384
     }
    
    ... ... @@ -3411,8 +3391,8 @@ vertical_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequenc
    3411 3391
         if ( !data )
    
    3412 3392
             return;
    
    3413 3393
     
    
    3414
    -    // Do not process vertical pan, if there was no "pan" signal for it.
    
    3415
    -    if ( !(data->m_allowedGestures & vertical_pan) )
    
    3394
    +    // Ignore the signal if the gesture isn't active
    
    3395
    +    if ( !(data->m_activeGestures & vertical_pan) )
    
    3416 3396
         {
    
    3417 3397
             return;
    
    3418 3398
         }
    
    ... ... @@ -3424,14 +3404,14 @@ vertical_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequenc
    3424 3404
             return;
    
    3425 3405
         }
    
    3426 3406
     
    
    3427
    -    data->m_allowedGestures &= ~vertical_pan;
    
    3428
    -
    
    3429 3407
         wxPanGestureEvent event(win->GetId());
    
    3430 3408
     
    
    3431 3409
         event.SetEventObject(win);
    
    3432 3410
         event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
    
    3433 3411
         event.SetGestureEnd();
    
    3434 3412
     
    
    3413
    +    data->m_activeGestures &= ~vertical_pan;
    
    3414
    +
    
    3435 3415
         win->GTKProcessEvent(event);
    
    3436 3416
     }
    
    3437 3417
     }
    
    ... ... @@ -3440,6 +3420,10 @@ extern "C" {
    3440 3420
     static void
    
    3441 3421
     pan_gesture_callback(GtkGesture* gesture, GtkPanDirection direction, gdouble offset, wxWindow* win)
    
    3442 3422
     {
    
    3423
    +    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3424
    +    if ( !data )
    
    3425
    +        return;
    
    3426
    +
    
    3443 3427
         // The function that retrieves the GdkEventSequence (which will further be used to get the gesture point)
    
    3444 3428
         // should be called only when the gestrure is active
    
    3445 3429
         if ( !gtk_gesture_is_active(gesture) )
    
    ... ... @@ -3461,44 +3445,47 @@ pan_gesture_callback(GtkGesture* gesture, GtkPanDirection direction, gdouble off
    3461 3445
         event.SetEventObject(win);
    
    3462 3446
         event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
    
    3463 3447
     
    
    3464
    -    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3465
    -    if ( !data )
    
    3448
    +    TrackedGesture gesture_type = direction == GTK_PAN_DIRECTION_UP || direction == GTK_PAN_DIRECTION_DOWN
    
    3449
    +                                    ? vertical_pan : horizontal_pan;
    
    3450
    +
    
    3451
    +    if ( !(data->m_activeGestures & (horizontal_pan | vertical_pan)) )
    
    3452
    +    {
    
    3453
    +        // For the pan gesture, unlike the others, we only consider the gesture started once we actually receive a pan signal
    
    3454
    +        data->m_activeGestures |= gesture_type;
    
    3455
    +        data->m_lastPanOffset = 0;
    
    3456
    +        event.SetGestureStart();
    
    3457
    +    }
    
    3458
    +    else if ( !(data->m_activeGestures & gesture_type) )
    
    3459
    +    {
    
    3460
    +        // We shouldn't receive horizontal pan events while a vertical pan is active and vice versa,
    
    3461
    +        // but let's ignore the event just in case
    
    3466 3462
             return;
    
    3463
    +    }
    
    3467 3464
     
    
    3468 3465
         // This is the difference between this and the last pan gesture event in the current sequence
    
    3469
    -    int delta = wxRound(offset - gs_lastOffset);
    
    3466
    +    int delta = wxRound(offset - data->m_lastPanOffset);
    
    3470 3467
     
    
    3471 3468
         switch ( direction )
    
    3472 3469
         {
    
    3473 3470
             case GTK_PAN_DIRECTION_UP:
    
    3474
    -            data->m_allowedGestures |= vertical_pan;
    
    3475 3471
                 event.SetDelta(wxPoint(0, -delta));
    
    3476 3472
                 break;
    
    3477 3473
     
    
    3478 3474
             case GTK_PAN_DIRECTION_DOWN:
    
    3479
    -            data->m_allowedGestures |= vertical_pan;
    
    3480 3475
                 event.SetDelta(wxPoint(0, delta));
    
    3481 3476
                 break;
    
    3482 3477
     
    
    3483 3478
             case GTK_PAN_DIRECTION_RIGHT:
    
    3484
    -            data->m_allowedGestures |= horizontal_pan;
    
    3485 3479
                 event.SetDelta(wxPoint(delta, 0));
    
    3486 3480
                 break;
    
    3487 3481
     
    
    3488 3482
             case GTK_PAN_DIRECTION_LEFT:
    
    3489
    -            data->m_allowedGestures |= horizontal_pan;
    
    3490 3483
                 event.SetDelta(wxPoint(-delta, 0));
    
    3491 3484
                 break;
    
    3492 3485
         }
    
    3493 3486
     
    
    3494
    -    // Update gs_lastOffset
    
    3495
    -    gs_lastOffset = offset;
    
    3496
    -
    
    3497
    -    if ( gs_gestureStart )
    
    3498
    -    {
    
    3499
    -        event.SetGestureStart();
    
    3500
    -        gs_gestureStart = false;
    
    3501
    -    }
    
    3487
    +    // Update m_lastPanOffset
    
    3488
    +    data->m_lastPanOffset = offset;
    
    3502 3489
     
    
    3503 3490
         // Cancel press and tap gesture if it is not active during "pan" signal.
    
    3504 3491
         if( !(data->m_activeGestures & press_and_tap) )
    
    ... ... @@ -3514,6 +3501,10 @@ extern "C" {
    3514 3501
     static void
    
    3515 3502
     zoom_gesture_callback(GtkGesture* gesture, gdouble scale, wxWindow* win)
    
    3516 3503
     {
    
    3504
    +    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3505
    +    if ( !data )
    
    3506
    +        return;
    
    3507
    +
    
    3517 3508
         gdouble x, y;
    
    3518 3509
     
    
    3519 3510
         if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
    
    ... ... @@ -3527,21 +3518,17 @@ zoom_gesture_callback(GtkGesture* gesture, gdouble scale, wxWindow* win)
    3527 3518
         event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
    
    3528 3519
         event.SetZoomFactor(scale);
    
    3529 3520
     
    
    3530
    -    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3531
    -    if ( !data )
    
    3532
    -        return;
    
    3533
    -
    
    3534
    -    // Cancel "Two FInger Tap Event" if scale has changed
    
    3535
    -    if ( wxRound(scale * 1000) != wxRound(gs_lastScale * 1000) )
    
    3521
    +    // Cancel "Two Finger Tap Event" if scale has changed
    
    3522
    +    if ( wxRound(scale * 1000) != wxRound(data->m_lastScale * 1000) )
    
    3536 3523
         {
    
    3537 3524
             data->m_allowedGestures &= ~two_finger_tap;
    
    3538 3525
         }
    
    3539 3526
     
    
    3540
    -    gs_lastScale = scale;
    
    3527
    +    data->m_lastScale = scale;
    
    3541 3528
     
    
    3542 3529
         // Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
    
    3543 3530
         // in the "end" signal is not a zoom center
    
    3544
    -    gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3531
    +    data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3545 3532
     
    
    3546 3533
         win->GTKProcessEvent(event);
    
    3547 3534
     }
    
    ... ... @@ -3551,6 +3538,10 @@ extern "C" {
    3551 3538
     static void
    
    3552 3539
     zoom_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
    
    3553 3540
     {
    
    3541
    +    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3542
    +    if ( !data )
    
    3543
    +        return;
    
    3544
    +
    
    3554 3545
         gdouble x, y;
    
    3555 3546
     
    
    3556 3547
         if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
    
    ... ... @@ -3558,17 +3549,19 @@ zoom_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(sequ
    3558 3549
             return;
    
    3559 3550
         }
    
    3560 3551
     
    
    3561
    -    gs_lastScale = 1.0;
    
    3562
    -
    
    3563 3552
         wxZoomGestureEvent event(win->GetId());
    
    3564 3553
     
    
    3565 3554
         event.SetEventObject(win);
    
    3566 3555
         event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
    
    3567 3556
         event.SetGestureStart();
    
    3568 3557
     
    
    3558
    +    data->m_activeGestures |= zoom;
    
    3559
    +
    
    3560
    +    data->m_lastScale = 1;
    
    3561
    +
    
    3569 3562
         // Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
    
    3570 3563
         // in the "end" signal is not a zoom center
    
    3571
    -    gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3564
    +    data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3572 3565
     
    
    3573 3566
         win->GTKProcessEvent(event);
    
    3574 3567
     }
    
    ... ... @@ -3578,12 +3571,24 @@ extern "C" {
    3578 3571
     static void
    
    3579 3572
     zoom_gesture_end_callback(GtkGesture* WXUNUSED(gesture), GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
    
    3580 3573
     {
    
    3574
    +    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3575
    +    if ( !data )
    
    3576
    +        return;
    
    3577
    +
    
    3578
    +    // Ignore the signal if the gesture isn't active
    
    3579
    +    if ( !(data->m_activeGestures & zoom) )
    
    3580
    +    {
    
    3581
    +        return;
    
    3582
    +    }
    
    3583
    +
    
    3581 3584
         wxZoomGestureEvent event(win->GetId());
    
    3582 3585
     
    
    3583 3586
         event.SetEventObject(win);
    
    3584
    -    event.SetPosition(gs_lastGesturePoint);
    
    3587
    +    event.SetPosition(data->m_lastGesturePoint);
    
    3585 3588
         event.SetGestureEnd();
    
    3586
    -    event.SetZoomFactor(gs_lastScale);
    
    3589
    +    event.SetZoomFactor(data->m_lastScale);
    
    3590
    +
    
    3591
    +    data->m_activeGestures &= ~zoom;
    
    3587 3592
     
    
    3588 3593
         win->GTKProcessEvent(event);
    
    3589 3594
     }
    
    ... ... @@ -3593,6 +3598,10 @@ extern "C" {
    3593 3598
     static void
    
    3594 3599
     rotate_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
    
    3595 3600
     {
    
    3601
    +    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3602
    +    if ( !data )
    
    3603
    +        return;
    
    3604
    +
    
    3596 3605
         gdouble x, y;
    
    3597 3606
     
    
    3598 3607
         if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
    
    ... ... @@ -3606,9 +3615,13 @@ rotate_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(se
    3606 3615
         event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
    
    3607 3616
         event.SetGestureStart();
    
    3608 3617
     
    
    3618
    +    data->m_activeGestures |= rotate;
    
    3619
    +
    
    3620
    +    data->m_lastAngleDelta = 0;
    
    3621
    +
    
    3609 3622
         // Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
    
    3610 3623
         // in the "end" signal is not a rotation center
    
    3611
    -    gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3624
    +    data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3612 3625
     
    
    3613 3626
         win->GTKProcessEvent(event);
    
    3614 3627
     }
    
    ... ... @@ -3616,8 +3629,12 @@ rotate_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(se
    3616 3629
     
    
    3617 3630
     extern "C" {
    
    3618 3631
     static void
    
    3619
    -rotate_gesture_callback(GtkGesture* gesture, gdouble WXUNUSED(angle_delta), gdouble angle, wxWindowGTK* win)
    
    3632
    +rotate_gesture_callback(GtkGesture* gesture, gdouble WXUNUSED(angle), gdouble angle_delta, wxWindowGTK* win)
    
    3620 3633
     {
    
    3634
    +    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3635
    +    if ( !data )
    
    3636
    +        return;
    
    3637
    +
    
    3621 3638
         gdouble x, y;
    
    3622 3639
     
    
    3623 3640
         if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
    
    ... ... @@ -3629,15 +3646,15 @@ rotate_gesture_callback(GtkGesture* gesture, gdouble WXUNUSED(angle_delta), gdou
    3629 3646
     
    
    3630 3647
         event.SetEventObject(win);
    
    3631 3648
         event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
    
    3632
    -
    
    3633
    -    event.SetRotationAngle(angle);
    
    3649
    +    // angle is the absolute orientation of the two fingers, angle_delta is the angle relative to when the gesure started
    
    3650
    +    event.SetRotationAngle(angle_delta);
    
    3634 3651
     
    
    3635 3652
         // Save the angle to set it when the gesture ends.
    
    3636
    -    gs_lastAngle = angle;
    
    3653
    +    data->m_lastAngleDelta = angle_delta;
    
    3637 3654
     
    
    3638 3655
         // Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
    
    3639 3656
         // in the "end" signal is not a rotation center
    
    3640
    -    gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3657
    +    data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
    
    3641 3658
     
    
    3642 3659
         win->GTKProcessEvent(event);
    
    3643 3660
     }
    
    ... ... @@ -3647,12 +3664,24 @@ extern "C" {
    3647 3664
     static void
    
    3648 3665
     rotate_gesture_end_callback(GtkGesture* WXUNUSED(gesture), GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
    
    3649 3666
     {
    
    3667
    +    wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
    
    3668
    +    if ( !data )
    
    3669
    +        return;
    
    3670
    +
    
    3671
    +    // Ignore the signal if the gesture isn't active
    
    3672
    +    if ( !(data->m_activeGestures & rotate) )
    
    3673
    +    {
    
    3674
    +        return;
    
    3675
    +    }
    
    3676
    +
    
    3650 3677
         wxRotateGestureEvent event(win->GetId());
    
    3651 3678
     
    
    3652 3679
         event.SetEventObject(win);
    
    3653
    -    event.SetPosition(gs_lastGesturePoint);
    
    3680
    +    event.SetPosition(data->m_lastGesturePoint);
    
    3654 3681
         event.SetGestureEnd();
    
    3655
    -    event.SetRotationAngle(gs_lastAngle);
    
    3682
    +    event.SetRotationAngle(data->m_lastAngleDelta);
    
    3683
    +
    
    3684
    +    data->m_activeGestures &= ~rotate;
    
    3656 3685
     
    
    3657 3686
         win->GTKProcessEvent(event);
    
    3658 3687
     }
    
    ... ... @@ -3981,6 +4010,9 @@ void wxWindowGesturesData::Reinit(wxWindowGTK* win,
    3981 4010
         m_activeGestures = 0;
    
    3982 4011
         m_touchSequence = nullptr;
    
    3983 4012
         m_rawTouchEvents = false;
    
    4013
    +    m_lastPanOffset = 0;
    
    4014
    +    m_lastScale = 1;
    
    4015
    +    m_lastAngleDelta = 0;
    
    3984 4016
     
    
    3985 4017
         if ( eventsMask & wxTOUCH_VERTICAL_PAN_GESTURE )
    
    3986 4018
         {
    
    ... ... @@ -3990,8 +4022,6 @@ void wxWindowGesturesData::Reinit(wxWindowGTK* win,
    3990 4022
     
    
    3991 4023
             gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER(m_vertical_pan_gesture), GTK_PHASE_TARGET);
    
    3992 4024
     
    
    3993
    -        g_signal_connect (m_vertical_pan_gesture, "begin",
    
    3994
    -                          G_CALLBACK(pan_gesture_begin_callback), win);
    
    3995 4025
             g_signal_connect (m_vertical_pan_gesture, "pan",
    
    3996 4026
                               G_CALLBACK(pan_gesture_callback), win);
    
    3997 4027
             g_signal_connect (m_vertical_pan_gesture, "end",
    
    ... ... @@ -4017,8 +4047,6 @@ void wxWindowGesturesData::Reinit(wxWindowGTK* win,
    4017 4047
     
    
    4018 4048
             gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER(m_horizontal_pan_gesture), GTK_PHASE_TARGET);
    
    4019 4049
     
    
    4020
    -        g_signal_connect (m_horizontal_pan_gesture, "begin",
    
    4021
    -                          G_CALLBACK(pan_gesture_begin_callback), win);
    
    4022 4050
             g_signal_connect (m_horizontal_pan_gesture, "pan",
    
    4023 4051
                               G_CALLBACK(pan_gesture_callback), win);
    
    4024 4052
             g_signal_connect (m_horizontal_pan_gesture, "end",
    

  • src/qt/checkbox.cpp
    ... ... @@ -62,9 +62,6 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
    62 62
     
    
    63 63
         GetQCheckBox()->setText( wxQtConvertString( label ) );
    
    64 64
     
    
    65
    -    // Do the initialization here as WXValidateStyle may fail in unit tests
    
    66
    -    bool ok = wxCheckBoxBase::Create( parent, id, pos, size, style, validator, name );
    
    67
    -
    
    68 65
         WXValidateStyle(&style);
    
    69 66
     
    
    70 67
         if ( style & wxCHK_2STATE )
    
    ... ... @@ -74,7 +71,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
    74 71
         if ( style & wxALIGN_RIGHT )
    
    75 72
             GetQCheckBox()->setLayoutDirection( Qt::RightToLeft );
    
    76 73
     
    
    77
    -    return ok;
    
    74
    +    return wxCheckBoxBase::Create( parent, id, pos, size, style, validator, name );
    
    78 75
     }
    
    79 76
     
    
    80 77
     QCheckBox* wxCheckBox::GetQCheckBox() const
    

  • src/qt/window.cpp
    ... ... @@ -1278,13 +1278,11 @@ void wxWindowQt::DoSetClientSize(int width, int height)
    1278 1278
         QWidget *qtWidget = QtGetClientWidget();
    
    1279 1279
         wxCHECK_RET( qtWidget, "window must be created" );
    
    1280 1280
     
    
    1281
    -    if ( qtWidget != GetHandle() )
    
    1282
    -    {
    
    1283
    -        int x, y;
    
    1284
    -        DoGetPosition(&x, &y);
    
    1285
    -        // Ensure that this window is correctly positioned in RTL layout.
    
    1286
    -        DoMoveWindow(x, y, width, height);
    
    1287
    -    }
    
    1281
    +    int x, y;
    
    1282
    +    DoGetPosition(&x, &y);
    
    1283
    +    DoMoveWindow(x, y, width, height);
    
    1284
    +
    
    1285
    +    // Ensure that this window is correctly positioned in RTL layout.
    
    1288 1286
     
    
    1289 1287
         QRect geometry = qtWidget->geometry();
    
    1290 1288
         const int dx = width - geometry.width();
    

  • src/unix/glegl.cpp
    ... ... @@ -685,6 +685,19 @@ void wxGLCanvasEGL::OnRealized()
    685 685
     
    
    686 686
     wxGLCanvasEGL::~wxGLCanvasEGL()
    
    687 687
     {
    
    688
    +    // Our "unmap" signal handler would be called from the base class dtor, so
    
    689
    +    // disconnect it to avoid accessing this object when it's already
    
    690
    +    // half-destroyed (and it is useless anyhow now as all it does is to call
    
    691
    +    // DestroyWaylandSubsurface() which we already do just below).
    
    692
    +    if ( m_canvas && m_canvas->m_widget )
    
    693
    +    {
    
    694
    +        g_signal_handlers_disconnect_by_func(
    
    695
    +            m_canvas->m_widget,
    
    696
    +            reinterpret_cast<gpointer>(gtk_glcanvas_unmap_callback),
    
    697
    +            this
    
    698
    +        );
    
    699
    +    }
    
    700
    +
    
    688 701
         if ( m_surface )
    
    689 702
             eglDestroySurface(m_display, m_surface);
    
    690 703
     #ifdef GDK_WINDOWING_WAYLAND
    

Reply all
Reply to author
Forward
0 new messages