Merge lp:~jassmith/unity/unity.redraw-on-resume into lp:~jassmith/unity/unity.fix-alt-arrow

Proposed by Jason Smith
Status: Superseded
Proposed branch: lp:~jassmith/unity/unity.redraw-on-resume
Merge into: lp:~jassmith/unity/unity.fix-alt-arrow
Diff against target: 86 lines (+51/-0)
2 files modified
manual-tests/NvResumeFromSuspend.txt (+11/-0)
plugins/unityshell/src/LauncherController.cpp (+40/-0)
To merge this branch: bzr merge lp:~jassmith/unity/unity.redraw-on-resume
Reviewer Review Type Date Requested Status
Gord Allott (community) Approve
Unity Team Pending
Review via email: mp+95779@code.launchpad.net

This proposal has been superseded by a proposal from 2012-03-05.

Description of the change

== The Problem ==
Unity paints a corrupted texture on screen after resume from suspend until it is redraw on Nvidia based system

== The Solutins ==
Repaint the launcher on resume from suspend (this seems to be the problem child)

== Testing ==
Manual test included. Automatic testing not really reasonable due to the nature of the issue (driver hack-a-round)

To post a comment you must log in.
Revision history for this message
Gord Allott (gordallott) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'manual-tests/NvResumeFromSuspend.txt'
2--- manual-tests/NvResumeFromSuspend.txt 1970-01-01 00:00:00 +0000
3+++ manual-tests/NvResumeFromSuspend.txt 2012-03-04 13:42:18 +0000
4@@ -0,0 +1,11 @@
5+Nvidia resume from suspend corruption
6+----------
7+This test ensures the screen is not corrupted after resume from suspend on nvidia cards.
8+
9+#. Ensure unity is running on a machine with a nvidia GPU using the proprietary nvidia driver
10+#. Put the machine to sleep
11+#. Resume the machine from sleep
12+#. Observe the area where the launcher would normally show
13+
14+Outcome:
15+ The screen should not display any visual corruption once X is finished updating after a resume.
16
17=== modified file 'plugins/unityshell/src/LauncherController.cpp'
18--- plugins/unityshell/src/LauncherController.cpp 2012-02-29 17:05:43 +0000
19+++ plugins/unityshell/src/LauncherController.cpp 2012-03-04 13:42:18 +0000
20@@ -18,6 +18,7 @@
21 * Tim Penhey <tim.penhey@canonical.com>
22 */
23
24+#include <gio/gio.h>
25 #include <glib/gi18n-lib.h>
26 #include <libbamf/libbamf.h>
27
28@@ -171,6 +172,9 @@
29
30 LauncherList launchers;
31
32+ GDBusConnection* dbus_connection_;
33+ guint resume_signal_id_;
34+
35 sigc::connection on_expoicon_activate_connection_;
36 sigc::connection launcher_key_press_connection_;
37 sigc::connection launcher_event_outside_connection_;
38@@ -251,6 +255,32 @@
39 });
40
41 parent_->AddChild(model_.get());
42+
43+ dbus_connection_ = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL);
44+ if (dbus_connection_)
45+ {
46+ auto handler = [](GDBusConnection* connection,
47+ const gchar* sender_name,
48+ const gchar* object_path,
49+ const gchar* interface_name,
50+ const gchar* signal_name,
51+ GVariant* parameters,
52+ gpointer user_data) {
53+ Controller::Impl* self = static_cast<Controller::Impl*>(user_data);
54+ for (auto launcher : self->launchers)
55+ launcher->QueueDraw();
56+ };
57+ resume_signal_id_ = g_dbus_connection_signal_subscribe(dbus_connection_,
58+ "org.freedesktop.UPower", // sender
59+ "org.freedesktop.UPower", // interface
60+ "Resuming", // member
61+ "/org/freedesktop/UPower", // path
62+ NULL, // arg0
63+ G_DBUS_SIGNAL_FLAGS_NONE,
64+ handler,
65+ this,
66+ NULL);
67+ }
68 }
69
70 Controller::Impl::~Impl()
71@@ -261,6 +291,16 @@
72 if (matcher_ != nullptr && on_view_opened_id_ != 0)
73 g_signal_handler_disconnect((gpointer) matcher_, on_view_opened_id_);
74
75+ if (dbus_connection_)
76+ {
77+ if (resume_signal_id_)
78+ g_dbus_connection_signal_unsubscribe(dbus_connection_, resume_signal_id_);
79+
80+ g_object_unref(dbus_connection_);
81+ dbus_connection_ = nullptr;
82+ resume_signal_id_ = 0;
83+ }
84+
85 delete device_section_;
86 }
87

Subscribers

People subscribed via source and target branches

to all changes: