summaryrefslogtreecommitdiff
diff options
authorNeil Jagdish Patel <neil.patel@canonical.com>2011-02-15 11:55:14 +0000
committerNeil Jagdish Patel <neil.patel@canonical.com>2011-02-15 11:55:14 +0000
commitbe8a66cb70e6c4d232c5c56dfee3cadd220e0fe4 (patch)
tree7d89d82b41a5a0b1f52987f3ca5a0af000043224
parent8bcb0eb29b25f3c1cda9f3f919f41f3d66044d58 (diff)
parentff2929f2a9369c03399527c0a8efe8eb5f50470a (diff)
Add support for swtiching themes properly
(bzr r853.4.15)
-rw-r--r--src/Launcher.cpp10
-rw-r--r--src/PanelIndicatorObjectView.cpp1
-rw-r--r--src/PanelStyle.cpp5
-rw-r--r--src/PanelView.cpp1
-rw-r--r--src/PlacesController.cpp2
-rw-r--r--src/QuicklistView.cpp2
-rw-r--r--src/unityshell.cpp4
-rw-r--r--tests/TestPanel.cpp4
-rwxr-xr-xtools/migrate_favorites.py6
9 files changed, 21 insertions, 14 deletions
diff --git a/src/Launcher.cpp b/src/Launcher.cpp
index 0b6591f1d..3b70aeeda 100644
--- a/src/Launcher.cpp
+++ b/src/Launcher.cpp
@@ -190,6 +190,7 @@ Launcher::Launcher (nux::BaseWindow* parent,
OnMouseMove.connect (sigc::mem_fun (this, &Launcher::RecvMouseMove));
OnMouseWheel.connect (sigc::mem_fun (this, &Launcher::RecvMouseWheel));
OnKeyPressed.connect (sigc::mem_fun (this, &Launcher::RecvKeyPressed));
+ OnEndFocus.connect (sigc::mem_fun (this, &Launcher::exitKeyNavMode));
QuicklistManager::Default ()->quicklist_opened.connect (sigc::mem_fun(this, &Launcher::RecvQuicklistOpened));
QuicklistManager::Default ()->quicklist_closed.connect (sigc::mem_fun(this, &Launcher::RecvQuicklistClosed));
@@ -360,6 +361,8 @@ Launcher::startKeyNavMode ()
void
Launcher::exitKeyNavMode ()
{
+ if (!_navmod_show_launcher)
+ return;
_navmod_show_launcher = false;
EnsureHiddenState ();
@@ -1164,7 +1167,7 @@ void Launcher::SetHidden (bool hidden)
_hidden = hidden;
SetTimeStruct (&_times[TIME_AUTOHIDE], &_times[TIME_AUTOHIDE], ANIM_DURATION_SHORT);
- _parent->EnableInputWindow(!hidden);
+ _parent->EnableInputWindow(!hidden, "launcher");
if (!hidden && _launcher_action_state == ACTION_DRAG_EXTERNAL)
ProcessDndLeave ();
@@ -1346,7 +1349,7 @@ void Launcher::SetHideMode (LauncherHideMode hidemode)
}
else
{
- _parent->EnableInputWindow(true);
+ _parent->EnableInputWindow(true, "launcher");
g_timeout_add (1000, &Launcher::StrutHack, this);
_parent->InputWindowEnableStruts(true);
}
@@ -2079,6 +2082,9 @@ void Launcher::StartIconDrag (LauncherIcon *icon)
_drag_window->UnReference ();
_drag_window = NULL;
}
+
+ if (_navmod_show_launcher)
+ exitKeyNavMode ();
_offscreen_drag_texture = nux::GetThreadGLDeviceFactory()->CreateSystemCapableDeviceTexture (_icon_size, _icon_size, 1, nux::BITFMT_R8G8B8A8);
_drag_window = new LauncherDragWindow (_offscreen_drag_texture);
diff --git a/src/PanelIndicatorObjectView.cpp b/src/PanelIndicatorObjectView.cpp
index c804ca128..f4a1ef474 100644
--- a/src/PanelIndicatorObjectView.cpp
+++ b/src/PanelIndicatorObjectView.cpp
@@ -33,6 +33,7 @@
PanelIndicatorObjectView::PanelIndicatorObjectView ()
: View (NUX_TRACKER_LOCATION),
+ _layout (NULL),
_proxy (NULL),
_entries ()
{
diff --git a/src/PanelStyle.cpp b/src/PanelStyle.cpp
index 7c04d6978..ebf089ed2 100644
--- a/src/PanelStyle.cpp
+++ b/src/PanelStyle.cpp
@@ -27,7 +27,7 @@ PanelStyle::PanelStyle ()
_offscreen = gtk_offscreen_window_new ();
gtk_widget_set_name (_offscreen, "UnityPanelWidget");
gtk_widget_set_size_request (_offscreen, 100, 24);
- gtk_widget_show (_offscreen);
+ gtk_widget_show_all (_offscreen);
g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name",
G_CALLBACK (PanelStyle::OnStyleChanged), this);
@@ -120,7 +120,8 @@ GdkPixbuf *
PanelStyle::GetBackground (int width, int height)
{
gtk_widget_set_size_request (_offscreen, width, height);
-
+ gdk_window_process_updates (gtk_widget_get_window (_offscreen), TRUE);
+
return gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (_offscreen));
}
diff --git a/src/PanelView.cpp b/src/PanelView.cpp
index 8a8b0071f..acaa9b6d3 100644
--- a/src/PanelView.cpp
+++ b/src/PanelView.cpp
@@ -158,7 +158,6 @@ PanelView::UpdateBackground ()
_last_width = geo.width;
_last_height = geo.height;
-
GdkPixbuf *pixbuf = _style->GetBackground (geo.width, geo.height);
nux::BaseTexture * texture2D = nux::CreateTexture2DFromPixbuf (pixbuf, true);
g_object_unref (pixbuf);
diff --git a/src/PlacesController.cpp b/src/PlacesController.cpp
index ad2aa125c..24763d047 100644
--- a/src/PlacesController.cpp
+++ b/src/PlacesController.cpp
@@ -78,7 +78,7 @@ void PlacesController::Show ()
return;
_window->ShowWindow (true, false);
- _window->EnableInputWindow (true, 1);
+ _window->EnableInputWindow (true, "places", true);
_window->GrabPointer ();
_window->GrabKeyboard ();
_window->NeedRedraw ();
diff --git a/src/QuicklistView.cpp b/src/QuicklistView.cpp
index 427ca7566..254919cdc 100644
--- a/src/QuicklistView.cpp
+++ b/src/QuicklistView.cpp
@@ -185,7 +185,7 @@ void QuicklistView::Show ()
{
// FIXME: ShowWindow shouldn't need to be called first
ShowWindow (true);
- EnableInputWindow (true, 1);
+ EnableInputWindow (true, "quicklist", true);
GrabPointer ();
NeedRedraw ();
diff --git a/src/unityshell.cpp b/src/unityshell.cpp
index b5c824449..ef17a276a 100644
--- a/src/unityshell.cpp
+++ b/src/unityshell.cpp
@@ -627,7 +627,7 @@ void UnityScreen::initLauncher (nux::NThread* thread, void* InitData)
self->launcherWindow->SetLayout(layout);
self->launcherWindow->SetBackgroundColor(nux::Color(0x00000000));
self->launcherWindow->ShowWindow(true);
- self->launcherWindow->EnableInputWindow(true);
+ self->launcherWindow->EnableInputWindow(true, "launcher");
self->launcherWindow->InputWindowEnableStruts(true);
/* FIXME: this should not be manual, should be managed with a
@@ -658,7 +658,7 @@ void UnityScreen::initLauncher (nux::NThread* thread, void* InitData)
self->panelWindow->SetLayout(layout);
self->panelWindow->SetBackgroundColor(nux::Color(0x00000000));
self->panelWindow->ShowWindow(true);
- self->panelWindow->EnableInputWindow(true);
+ self->panelWindow->EnableInputWindow(true, "panel");
self->panelWindow->InputWindowEnableStruts(true);
LOGGER_END_PROCESS ("initLauncher-Panel");
diff --git a/tests/TestPanel.cpp b/tests/TestPanel.cpp
index 98be4284a..7e3cd1c07 100644
--- a/tests/TestPanel.cpp
+++ b/tests/TestPanel.cpp
@@ -33,8 +33,8 @@ void ThreadWidgetInit(nux::NThread* thread, void* InitData)
nux::VLayout *layout = new nux::VLayout(TEXT(""), NUX_TRACKER_LOCATION);
PanelView *view = new PanelView ();
- view->SetMinMaxSize(1024, 24);
- layout->AddView(view, 1, nux::eCenter, nux::eFix);
+ //view->SetMinMaxSize(1024, 24);
+ layout->AddView(view, 1, nux::eCenter, nux::eFull);
layout->SetContentDistribution(nux::eStackCenter);
nux::GetGraphicsThread()->SetLayout (layout);
diff --git a/tools/migrate_favorites.py b/tools/migrate_favorites.py
index b7fa791ee..7fae599fa 100755
--- a/tools/migrate_favorites.py
+++ b/tools/migrate_favorites.py
@@ -171,7 +171,7 @@ if migration_level < '3.2.0':
migrating_chapter_log("unity mutter", apps_list, unity_mutter_favorites_list, log_file)
for candidate in unity_mutter_favorites_list:
candidate_path = '/desktop/unity/launcher/favorites/%s' % candidate
- if (client.get_string('%s/type' % candidate_path) == 'application'):
+ if (candidate and client.get_string('%s/type' % candidate_path) == 'application'):
launcher_location = client.get_string('%s/desktop_file' % candidate_path)
position = client.get_string('%s/desktop_file' % candidate_path)
if launcher_location:
@@ -186,7 +186,7 @@ if migration_level < '3.2.0':
migrating_chapter_log("netbook-launcher favorites", apps_list, lucid_favorites_list, log_file)
for candidate in lucid_favorites_list:
candidate_path = '/apps/netbook-launcher/favorites/%s' % candidate
- if (client.get_string('%s/type' % candidate_path) == 'application'):
+ if (candidate and client.get_string('%s/type' % candidate_path) == 'application'):
launcher_location = client.get_string('%s/desktop_file' % candidate_path)
if launcher_location:
apps_list = register_new_app(launcher_location, apps_list, log_file)
@@ -197,7 +197,7 @@ if migration_level < '3.2.0':
migrating_chapter_log("gnome-panel items", apps_list, candidate_objects, log_file)
for candidate in candidate_objects:
candidate_path = '/apps/panel/objects/%s' % candidate
- if (client.get_string('%s/object_type' % candidate_path) == 'launcher-object'
+ if (candidate and client.get_string('%s/object_type' % candidate_path) == 'launcher-object'
and client.get_string('%s/toplevel_id' % candidate_path) in panel_list):
launcher_location = client.get_string('%s/launcher_location' % candidate_path)
if launcher_location: