Skip to content

Commit

Permalink
fix color picker crashes on Wayland
Browse files Browse the repository at this point in the history
It does not work yet on Wayland. Support for that can be added using D-
Bus. See kdenlive's ColorPickerWidget that uses that. Qt has a separate
D-Bus module that needs to be integrated. That is outside the scope of
this commit and release. Try it for next.
  • Loading branch information
ddennedy committed Jan 9, 2025
1 parent d3277d1 commit a09c0c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/docks/filesdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@ FilesDock::FilesDock(QWidget *parent)
ui->locationsCombo->addItem(name, path);
}
ui->locationsCombo->setEditText(QDir::toNativeSeparators(Settings.filesCurrentDir()));
connect(ui->locationsCombo->lineEdit(), &QLineEdit::editingFinished, this, &FilesDock::onLocationsEditingFinished);
connect(ui->locationsCombo->lineEdit(), &QLineEdit::editingFinished, this,
&FilesDock::onLocationsEditingFinished);

m_filesModel = new FilesModel(this);
m_filesModel->setOption(QFileSystemModel::DontUseCustomDirectoryIcons);
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,7 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event)

void MainWindow::dragEnterEvent(QDragEnterEvent *event)
{
// Simulate the player firing a dragStarted even to make the playlist close
// Simulate the player firing a dragStarted event to make the playlist close
// its help text view. This lets one drop a clip directly into the playlist
// from a fresh start.
auto *videoWidget = (Mlt::VideoWidget *) &Mlt::Controller::singleton();
Expand Down
4 changes: 2 additions & 2 deletions src/qmltypes/colorpickeritem.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2022 Meltytech, LLC
* Copyright (c) 2014-2024 Meltytech, LLC
* Inspiration: KDENLIVE colorpickerwidget.cpp by Till Theato ([email protected])
* Inspiration: QColorDialog.cpp
*
Expand Down Expand Up @@ -48,7 +48,7 @@ void ColorPickerItem::grabColor()
QPixmap screenGrab = screen->grabWindow(0, m_selectedRect.x(), m_selectedRect.y(),
m_selectedRect.width(), m_selectedRect.height());
QImage image = screenGrab.toImage();
int numPixel = image.width() * image.height();
int numPixel = qMax(image.width() * image.height(), 1);
int sumR = 0;
int sumG = 0;
int sumB = 0;
Expand Down

0 comments on commit a09c0c6

Please sign in to comment.