File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -361,8 +361,17 @@ bool TopBar::eventFilter(QObject *object, QEvent *event) {
361361 event->accept ();
362362 } else if (event->type () == QEvent::MouseMove) {
363363 if (canMoveTopbar) {
364- if (!this ->windowHandle ()->startSystemMove ()){
365- QMouseEvent *e = (QMouseEvent *) event;
364+ QMouseEvent *e = (QMouseEvent *) event;
365+ if (!(e->buttons () & Qt::LeftButton)) {
366+ // Mouse release event was missed; stop dragging.
367+ canMoveTopbar = false ;
368+ ui->buttonIcon ->setCursor (Qt::ArrowCursor);
369+ } else if (this ->windowHandle ()->startSystemMove ()){
370+ // The window manager now owns the drag and will consume the
371+ // mouse release event, so reset our drag state immediately.
372+ canMoveTopbar = false ;
373+ ui->buttonIcon ->setCursor (Qt::ArrowCursor);
374+ } else {
366375 ui->buttonIcon ->setCursor (Qt::ClosedHandCursor);
367376 move (e->globalX () - pressedMouseX, e->globalY () - pressedMouseY);
368377 }
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ QPushButton {
3737 margin: 2px;
3838 color: rgba(0, 0, 0, 0.7);
3939 font-size: 18px;
40+ outline: none;
41+ }
42+
43+ QPushButton:focus {
44+ outline: none;
4045}
4146
4247QPushButton:hover {
You can’t perform that action at this time.
0 commit comments