octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53807] KDE QDockWIdget titlebar mouse drag cr


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #53807] KDE QDockWIdget titlebar mouse drag creates defective floated focus for Qt 5.3.2 -> 5.4.1
Date: Thu, 3 May 2018 04:16:28 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #2, bug #53807 (project octave):

The "work-around" for this one is in the patch for Bug #53276, i.e.,
https://savannah.gnu.org/support/download.php?file_id=44067

We could separate the code if this bug fix should be separate.  In any case,
I'll give the bulk changes just to give an idea of the concept.  Basically,
the code additions recognize when a drag-and-drop float occurs then
immediately turns that window into a direct-floated window by docking and
refloating.  The affect on appearance isn't too bad--just a momentary flash of
the window.  (The title-bar-double-click and undock-button-press floats have
no flash effect.)

Here are the main components:

>From variable-editor.cc:


// See  Octave bug #53807 and https://bugreports.qt.io/browse/QTBUG-44813
#if (QT_VERSION >= 0x050302) && (QT_VERSION <= QTBUG_44813_FIX_VERSION)

  bool
  variable_dock_widget::event (QEvent *event)
  {
    // low-level check of whether docked-widget became a window via
    // via drag-and-drop
    if (event->type () == QEvent::MouseButtonPress)
      m_waiting_for_mouse_move = false;
    if (event->type () == QEvent::MouseMove && m_waiting_for_mouse_move)
      {
        m_waiting_for_mouse_move = false;
        m_waiting_for_mouse_button_release = true;
      }
    if (event->type () == QEvent::MouseButtonRelease &&
m_waiting_for_mouse_button_release)
      {
        m_waiting_for_mouse_button_release = false;
        m_waiting_for_activation_change = true;
      }
    if (event->type () == QEvent::ActivationChange &&
m_waiting_for_activation_change)
      {
        m_waiting_for_activation_change = false;
        bool retval = QDockWidget::event (event);
        if (isFloating ())
          {
            emit queue_unfloat_float ();
          }
        return retval;
      }

    return QDockWidget::event (event);
  }

  void
  variable_dock_widget::unfloat_float (void)
  {
    setFloating (false);
    setFloating (true);
  }
#else


and from variable-editor.h:


// See Octave bug #53807 and https://bugreports.qt.io/browse/QTBUG-44813
#define QTBUG_44813_FIX_VERSION 0x999999
  signals:

    void queue_unfloat_float (void);

  protected slots:

    void unfloat_float (void);

#if (QT_VERSION >= 0x050302) && (QT_VERSION <= QTBUG_44813_FIX_VERSION)
  protected:

    bool event (QEvent *event);

  private:

    bool m_waiting_for_mouse_move;

    bool m_waiting_for_mouse_button_release;

    bool m_waiting_for_activation_change;
#endif


The idea with this define:


#define QTBUG_44813_FIX_VERSION 0x999999


is to replace 0x999999 by the Qt version that fixes the problem.  In fact, I'm
not sure the developers know exactly when the bug started, so even the lower
limit of 0x050302 could have had its own definition.  Nonetheless, that's the
point of it.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53807>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]