From 2021c6c8f74df35f7bf71f9d4a6208c055a3cf15 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 30 Jun 2014 13:52:46 +0200 Subject: Fix pixel noise in X11 systray icons that are not 22x22 If a system tray icon is set to a non default size by an X11 system tray, the area beyond 22x22 will not be painted, since the first paint is performed before the first resize, and the first resize does not trigger expose either. The bug can be seen in KDE if the system tray is not 22 pixel height. This patch triggers updates on resize to ensure we always repaint fully on resize. Change-Id: Ia81d2329a2c9faff220f07163ac38cafbd520ffc Reviewed-by: Shawn Rutledge --- src/widgets/util/qsystemtrayicon_x11.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/widgets/util') diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp index 347e5701c0..21ce23437f 100644 --- a/src/widgets/util/qsystemtrayicon_x11.cpp +++ b/src/widgets/util/qsystemtrayicon_x11.cpp @@ -83,6 +83,7 @@ protected: virtual void mouseDoubleClickEvent(QMouseEvent *ev); virtual bool event(QEvent *); virtual void paintEvent(QPaintEvent *); + virtual void resizeEvent(QResizeEvent *); private slots: void systemTrayWindowChanged(QScreen *screen); @@ -205,6 +206,11 @@ void QSystemTrayIconSys::paintEvent(QPaintEvent *) q->icon().paint(&painter, rect); } +void QSystemTrayIconSys::resizeEvent(QResizeEvent *) +{ + update(); +} + //////////////////////////////////////////////////////////////////////////// QSystemTrayIconPrivate::QSystemTrayIconPrivate() -- cgit v1.2.3