Cherry-picking upstream release 0.11.3.

ubuntu/disco debian/0.11.3-1
Alf Gaida 8 years ago
parent 3194275f96
commit 6fc1ada88a

@ -3,4 +3,4 @@ Upstream Authors:
Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Copyright:
Copyright (c) 2013-2016 LXQt team
Copyright (c) 2013-2017 LXQt team

@ -1,7 +1,17 @@
pcmanfm-qt-0.11.2 / 2016-12-21
pcmanfm-qt-0.11.3 / 2017-01-14
==============================
* remove 0.11.3 changelog entries
* Bump patch version
* Release 0.11.3: Update changelog
* Add a workaround for the Qt5 bug which causes broken wallpaper background.
* Update AUTHORS
0.11.2 / 2016-12-21
===================
* Release 0.11.2: Update changelog
* Use static_cast instead of the C style cast
* Fix sign-compare warnings
* Prevent wrong clearing of filter-bar with path buttons (#432)

@ -8,7 +8,7 @@ endif (POLICY CMP0063)
set(PCMANFM_QT_VERSION_MAJOR 0)
set(PCMANFM_QT_VERSION_MINOR 11)
set(PCMANFM_QT_VERSION_PATCH 2)
set(PCMANFM_QT_VERSION_PATCH 3)
set(PCMANFM_QT_VERSION ${PCMANFM_QT_VERSION_MAJOR}.${PCMANFM_QT_VERSION_MINOR}.${PCMANFM_QT_VERSION_PATCH})
set(LXQTBT_MINIMUM_VERSION "0.1.0")

6
debian/changelog vendored

@ -1,3 +1,9 @@
pcmanfm-qt (0.11.3-1) unstable; urgency=medium
* Cherry-picking upstream release 0.11.3.
-- Alf Gaida <agaida@siduction.org> Sat, 14 Jan 2017 03:54:54 +0100
pcmanfm-qt (0.11.2-1) unstable; urgency=medium
* Cherry-picking upstream release 0.11.2.

@ -26,7 +26,7 @@
#include <QFile>
#include <QPixmap>
#include <QPalette>
#include <QBrush>
#include <QLayout>
#include <QDebug>
#include <QTimer>
@ -36,6 +36,7 @@
#include <QShortcut>
#include <QDropEvent>
#include <QMimeData>
#include <QPaintEvent>
#include "./application.h"
#include "mainwindow.h"
@ -81,6 +82,13 @@ DesktopWindow::DesktopWindow(int screenNum):
listView_->setResizeMode(QListView::Adjust);
listView_->setFlow(QListView::TopToBottom);
// This is to workaround Qt bug 54384 which affects Qt >= 5.6
// https://bugreports.qt.io/browse/QTBUG-54384
// Setting a QPixmap larger then the screen resolution to the background of a list view won't work.
// So we did a hack here: Disable the automatic background painting.
// Then paint the background of the list view ourselves by hook into its paint event handling method with a event filter.
listView_->viewport()->setAutoFillBackground(false);
// NOTE: When XRnadR is in use, the all screens are actually combined to form a
// large virtual desktop and only one DesktopWindow needs to be created and screenNum is -1.
// In some older multihead setups, such as xinerama, every physical screen
@ -121,6 +129,7 @@ DesktopWindow::DesktopWindow(int screenNum):
connect(this, &DesktopWindow::openDirRequested, this, &DesktopWindow::onOpenDirRequested);
listView_->installEventFilter(this);
listView_->viewport()->installEventFilter(this);
// setup shortcuts
QShortcut* shortcut;
@ -150,6 +159,7 @@ DesktopWindow::DesktopWindow(int screenNum):
}
DesktopWindow::~DesktopWindow() {
listView_->viewport()->removeEventFilter(this);
listView_->removeEventFilter(this);
if(relayoutTimer_)
@ -285,14 +295,7 @@ QImage DesktopWindow::loadWallpaperFile(QSize requiredSize) {
// really generate the background pixmap according to current settings and apply it.
void DesktopWindow::updateWallpaper() {
// reset the brush
// QPalette palette(listView_->palette());
QPalette palette(Fm::FolderView::palette());
if(wallpaperMode_ == WallpaperNone) { // use background color only
palette.setBrush(QPalette::Base, bgColor_);
}
else { // use wallpaper
if(wallpaperMode_ != WallpaperNone) { // use wallpaper
QPixmap pixmap;
QImage image;
if(wallpaperMode_ == WallpaperTile) { // use the original size
@ -327,16 +330,7 @@ void DesktopWindow::updateWallpaper() {
}
}
wallpaperPixmap_ = pixmap;
if(!pixmap.isNull()) {
QBrush brush(pixmap);
palette.setBrush(QPalette::Base, brush);
}
else // if the image is not loaded, fallback to use background color only
palette.setBrush(QPalette::Base, bgColor_);
}
//FIXME: we should set the pixmap to X11 root window?
setPalette(palette);
}
void DesktopWindow::updateFromSettings(Settings& settings) {
@ -531,6 +525,19 @@ void DesktopWindow::removeBottomGap() {
setShadow(settings.desktopShadowColor());
}
void DesktopWindow::paintBackground(QPaintEvent *event) {
// This is to workaround Qt bug 54384 which affects Qt >= 5.6
// https://bugreports.qt.io/browse/QTBUG-54384
// Since Qt does not paint the background of the QListView using the QPixmap we set properly, we do it ourselves.
QPainter painter(listView_->viewport()); // the painter paints on the viewport widget, not the QListView.
if(wallpaperMode_ == WallpaperNone || wallpaperPixmap_.isNull()) {
painter.fillRect(event->rect(), QBrush(bgColor_));
}
else {
painter.drawPixmap(event->rect(), wallpaperPixmap_, event->rect());
}
}
// QListView does item layout in a very inflexible way, so let's do our custom layout again.
// FIXME: this is very inefficient, but due to the design flaw of QListView, this is currently the only workaround.
void DesktopWindow::relayoutItems() {
@ -876,6 +883,10 @@ bool DesktopWindow::eventFilter(QObject * watched, QEvent * event) {
}
else if(watched == listView_->viewport()) {
switch(event->type()) {
case QEvent::Paint: {
paintBackground(static_cast<QPaintEvent*>(event));
break;
}
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
if(showWmMenu_) {

@ -119,6 +119,7 @@ protected Q_SLOTS:
private:
void removeBottomGap();
void paintBackground(QPaintEvent* event);
private:
Fm::ProxyFolderModel* proxyModel_;

Loading…
Cancel
Save