Merge lp:~aacid/unity-2d/x11embed_pidgin into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 1113
Merged at revision: 1112
Proposed branch: lp:~aacid/unity-2d/x11embed_pidgin
Merge into: lp:unity-2d
Diff against target: 28 lines (+10/-0)
2 files modified
panel/applets/legacytray/x11embedcontainer.cpp (+6/-0)
tests/manual-tests/panel.txt (+4/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/x11embed_pidgin
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+107967@code.launchpad.net

Commit message

[panel] Update d->attr before using its values - some QX11EmbedContainers set their dimensions late

Description of the change

Update d->attr before using its values

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Looks good, thank you

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panel/applets/legacytray/x11embedcontainer.cpp'
2--- panel/applets/legacytray/x11embedcontainer.cpp 2012-01-13 15:14:56 +0000
3+++ panel/applets/legacytray/x11embedcontainer.cpp 2012-05-30 13:00:26 +0000
4@@ -225,6 +225,12 @@
5 // size #2.
6 XImage *ximage = XGetImage(dpy, pixmap, 0, 0, width(), height(), AllPlanes, ZPixmap);
7 if (!ximage) {
8+ // Make sure the attr are updated, Pidgin changes its widthxheight late in the game
9+ if (!XGetWindowAttributes(QX11Info::display(), clientWinId(), &d->attr)) {
10+ error(QX11EmbedContainer::Unknown);
11+ return;
12+ }
13+
14 int ximageWidth = qMin(d->attr.width, width());
15 int ximageHeight = qMin(d->attr.height, height());
16 ximage = XGetImage(dpy, pixmap, 0, 0, ximageWidth, ximageHeight, AllPlanes, ZPixmap);
17
18=== modified file 'tests/manual-tests/panel.txt'
19--- tests/manual-tests/panel.txt 2012-05-25 09:45:32 +0000
20+++ tests/manual-tests/panel.txt 2012-05-30 13:00:26 +0000
21@@ -81,3 +81,7 @@
22 * Click in the panel (not in window label nor menus)
23 * Verify focus goes to the maximized window
24 ----
25+ * Add 'pidgin' to /desktop/unity/panel/systray-whitelist in dconf-editor
26+ * Start pidgin
27+ * Verify the systray icon of pidgin appears in the panel
28+----

Subscribers

People subscribed via source and target branches