diff options
| -rw-r--r-- | dash/DashView.cpp | 13 | ||||
| -rw-r--r-- | debian/changelog | 55 | ||||
| -rw-r--r-- | hud/HudView.cpp | 11 | ||||
| -rw-r--r-- | panel/PanelMenuView.cpp | 95 | ||||
| -rw-r--r-- | panel/PanelMenuView.h | 7 | ||||
| -rw-r--r-- | tests/autopilot/unity/emulators/launcher.py | 2 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/__init__.py | 85 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/launcher/__init__.py | 2 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/launcher/test_capture.py | 2 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/test_switcher.py | 3 | ||||
| -rw-r--r-- | tools/convert-files/compiz-profile-active-unity.convert | 2 | ||||
| -rw-r--r-- | tools/convert-files/compiz-profile-unity.convert | 2 |
12 files changed, 217 insertions, 62 deletions
diff --git a/dash/DashView.cpp b/dash/DashView.cpp index 360ef81d8..7969354fa 100644 --- a/dash/DashView.cpp +++ b/dash/DashView.cpp @@ -38,6 +38,7 @@ #include "unity-shared/PanelStyle.h" #include "unity-shared/UBusMessages.h" #include "unity-shared/UnitySettings.h" +#include "unity-shared/WindowManager.h" namespace unity { @@ -1592,15 +1593,15 @@ nux::Area* DashView::FindKeyFocusArea(unsigned int key_symbol, // Not sure if Enter should be a navigation key direction = KEY_NAV_ENTER; break; - case NUX_VK_F4: - // Maybe we should not do it here, but it needs to be checked where - // we are able to know if alt is pressed. - if (special_keys_state == NUX_STATE_ALT) + default: + auto const& close_key = WindowManager::Default().close_window_key(); + + if (close_key.first == special_keys_state && close_key.second == x11_key_code) { ubus_manager_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST); + return nullptr; } - break; - default: + direction = KEY_NAV_NONE; } diff --git a/debian/changelog b/debian/changelog index 9427a5508..04860cb77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -unity (6.12.0daily13.01.25.1-0ubuntu2) UNRELEASED; urgency=low +unity (6.12.0daily13.02.04.1-0ubuntu1) raring; urgency=low * debian/control: - recommends indicator-sync so it gets installed by default @@ -9,7 +9,58 @@ unity (6.12.0daily13.01.25.1-0ubuntu2) UNRELEASED; urgency=low * debian/control: - bump compiz build-dep due to the last ABI break - -- Sebastien Bacher <seb128@ubuntu.com> Thu, 31 Jan 2013 11:39:19 +0100 + [ Brandon Schaefer ] + * [regression] Clicking on the indicators when the Dash is open no + longer closes the Dash. (LP: #1109150) + * [staging][raring] Dash Maximise/Restore button depends on the + launcher icon size. (LP: #1101310) + + [ Romain Perier ] + * The Dash closes when trying to switch to the Command lens (Alt+F2) + (LP: #1019457) + + [ Marco Trevisan (Treviño) ] + * Launcher can have smaller size on monitor resolution change (LP: + #1105382) + * Dragging down a window from the panel on an external monitor, + restores it at wrong offset (LP: #1104043) + * [regression] Alt+Tab/Alt+grave brings other window to the front but + loses focus entirely. (LP: #1111620) + * Quicklist items need a way to be ellipsized (LP: #1111471) + + [ Charles Kerr <charles.kerr@canonical.com>, Andrea Azzarone ] + * the GObject subclasses in tests/ don't dispose() properly (LP: + #986875) + + [ Nicolas d'Offay ] + * Speed up dash blur (LP: #1102410) + + [ Manuel de la Pena ] + * API changes to FindKeyFocusArea in the Preview class stops more + complicated previous fom setting the correct focus (LP: #1102387) + + [ MC Return ] + * Wrong description in Dconf key + com.canonical.unity.launcher.favorites (LP: #1112560) + * Keyboard shortcut overlay says Ctrl+Super+Down "minimises" the + current window, but it doesn't (LP: #966099) + + [ Andrea Azzarone ] + * unmounting any gvfs-mounted device from unity menu crashes compiz + (LP: #1111389) + * compiz crashed with SIGSEGV in async_wrapper_callback() from + g_simple_async_result_complete() from + _g_simple_async_result_complete_with_cancellable() from + unmount_reply() (LP: #1102926) + + [ Łukasz 'sil2100' Zemczak ] + * SwitcherControllerImpl autopilot test failures in unity - + 6.12.0daily13.01.29.2-0ubuntu1 (LP: #1109192) + + [ Automatic PS uploader ] + * Automatic snapshot from revision 3117 + + -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Mon, 04 Feb 2013 09:59:13 +0000 unity (6.12.0daily13.01.25.1-0ubuntu1) raring; urgency=low diff --git a/hud/HudView.cpp b/hud/HudView.cpp index a5d91a571..e0c08c72a 100644 --- a/hud/HudView.cpp +++ b/hud/HudView.cpp @@ -32,6 +32,7 @@ #include "unity-shared/UBusMessages.h" #include "unity-shared/DashStyle.h" +#include "unity-shared/WindowManager.h" namespace unity { @@ -648,13 +649,15 @@ nux::Area* View::FindKeyFocusArea(unsigned int event_type, // Not sure if Enter should be a navigation key direction = nux::KEY_NAV_ENTER; break; - case NUX_VK_F4: - if (special_keys_state == nux::NUX_STATE_ALT) + default: + auto const& close_key = WindowManager::Default().close_window_key(); + + if (close_key.first == special_keys_state && close_key.second == x11_key_code) { ubus.SendMessage(UBUS_HUD_CLOSE_REQUEST); + return nullptr; } - break; - default: + direction = nux::KEY_NAV_NONE; break; } diff --git a/panel/PanelMenuView.cpp b/panel/PanelMenuView.cpp index 03d86eab0..d3416562e 100644 --- a/panel/PanelMenuView.cpp +++ b/panel/PanelMenuView.cpp @@ -80,25 +80,63 @@ PanelMenuView::PanelMenuView() , menus_discovery_fadein_(DEFAULT_DISCOVERY_FADEIN) , menus_discovery_fadeout_(DEFAULT_DISCOVERY_FADEOUT) { - layout_->SetContentDistribution(nux::MAJOR_POSITION_START); BamfWindow* active_win = bamf_matcher_get_active_window(matcher_); if (BAMF_IS_WINDOW(active_win)) active_xid_ = bamf_window_get_xid(active_win); - view_opened_signal_.Connect(matcher_, "view-opened", - sigc::mem_fun(this, &PanelMenuView::OnViewOpened)); - view_closed_signal_.Connect(matcher_, "view-closed", - sigc::mem_fun(this, &PanelMenuView::OnViewClosed)); + SetupPanelMenuViewSignals(); + SetupWindowButtons(); + SetupTitlebarGrabArea(); + SetupWindowManagerSignals(); + SetupUBusManagerInterests(); + + style_changed_connection_ = panel::Style::Instance().changed.connect([&] { + window_buttons_->ComputeContentSize(); + layout_->SetLeftAndRightPadding(window_buttons_->GetContentWidth(), 0); + + Refresh(true); + FullRedraw(); + }); + + opacity = 0.0f; + + Refresh(); + FullRedraw(); +} + +PanelMenuView::~PanelMenuView() +{ + style_changed_connection_.disconnect(); + window_buttons_->UnParentObject(); + titlebar_grab_area_->UnParentObject(); +} + +void PanelMenuView::SetupPanelMenuViewSignals() +{ active_win_changed_signal_.Connect(matcher_, "active-window-changed", sigc::mem_fun(this, &PanelMenuView::OnActiveWindowChanged)); active_app_changed_signal_.Connect(matcher_, "active-application-changed", sigc::mem_fun(this, &PanelMenuView::OnActiveAppChanged)); + view_opened_signal_.Connect(matcher_, "view-opened", + sigc::mem_fun(this, &PanelMenuView::OnViewOpened)); + view_closed_signal_.Connect(matcher_, "view-closed", + sigc::mem_fun(this, &PanelMenuView::OnViewClosed)); + + mouse_enter.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseEnter)); + mouse_leave.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseLeave)); + + opacity_animator_.updated.connect(sigc::mem_fun(this, &PanelMenuView::OnFadeAnimatorUpdated)); +} + +void PanelMenuView::SetupWindowButtons() +{ window_buttons_ = new WindowButtons(); window_buttons_->SetParentObject(this); window_buttons_->monitor = monitor_; window_buttons_->controlled_window = active_xid_; + window_buttons_->opacity = 0.0f; window_buttons_->SetLeftAndRightPadding(MAIN_LEFT_PADDING, MENUBAR_PADDING); window_buttons_->SetMaximumHeight(panel::Style::Instance().panel_height); window_buttons_->ComputeContentSize(); @@ -109,9 +147,18 @@ PanelMenuView::PanelMenuView() window_buttons_->opacity.changed.connect(sigc::hide(sigc::mem_fun(this, &PanelMenuView::QueueDraw))); AddChild(window_buttons_.GetPointer()); + SetupLayout(); +} + +void PanelMenuView::SetupLayout() +{ + layout_->SetContentDistribution(nux::MAJOR_POSITION_START); layout_->SetLeftAndRightPadding(window_buttons_->GetContentWidth(), 0); layout_->SetBaseHeight(panel::Style::Instance().panel_height); +} +void PanelMenuView::SetupTitlebarGrabArea() +{ titlebar_grab_area_ = new PanelTitlebarGrabArea(); titlebar_grab_area_->SetParentObject(this); titlebar_grab_area_->activate_request.connect(sigc::mem_fun(this, &PanelMenuView::OnMaximizedActivate)); @@ -120,8 +167,13 @@ PanelMenuView::PanelMenuView() titlebar_grab_area_->grab_started.connect(sigc::mem_fun(this, &PanelMenuView::OnMaximizedGrabStart)); titlebar_grab_area_->grab_move.connect(sigc::mem_fun(this, &PanelMenuView::OnMaximizedGrabMove)); titlebar_grab_area_->grab_end.connect(sigc::mem_fun(this, &PanelMenuView::OnMaximizedGrabEnd)); + titlebar_grab_area_->mouse_enter.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseEnter)); + titlebar_grab_area_->mouse_leave.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseLeave)); AddChild(titlebar_grab_area_.GetPointer()); +} +void PanelMenuView::SetupWindowManagerSignals() +{ WindowManager& wm = WindowManager::Default(); wm.window_minimized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMinimized)); wm.window_unminimized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnminimized)); @@ -138,43 +190,16 @@ PanelMenuView::PanelMenuView() wm.initiate_expo.connect(sigc::mem_fun(this, &PanelMenuView::OnExpoInitiate)); wm.terminate_expo.connect(sigc::mem_fun(this, &PanelMenuView::OnExpoTerminate)); wm.screen_viewport_switch_ended.connect(sigc::mem_fun(this, &PanelMenuView::OnExpoTerminate)); +} - style_changed_connection_ = panel::Style::Instance().changed.connect([&] { - window_buttons_->ComputeContentSize(); - layout_->SetLeftAndRightPadding(window_buttons_->GetContentWidth(), 0); - - Refresh(true); - FullRedraw(); - }); - - mouse_enter.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseEnter)); - mouse_leave.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseLeave)); - //mouse_move.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseMove)); - - titlebar_grab_area_->mouse_enter.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseEnter)); - titlebar_grab_area_->mouse_leave.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseLeave)); - +void PanelMenuView::SetupUBusManagerInterests() +{ ubus_manager_.RegisterInterest(UBUS_SWITCHER_SHOWN, sigc::mem_fun(this, &PanelMenuView::OnSwitcherShown)); ubus_manager_.RegisterInterest(UBUS_LAUNCHER_START_KEY_NAV, sigc::mem_fun(this, &PanelMenuView::OnLauncherKeyNavStarted)); ubus_manager_.RegisterInterest(UBUS_LAUNCHER_END_KEY_NAV, sigc::mem_fun(this, &PanelMenuView::OnLauncherKeyNavEnded)); ubus_manager_.RegisterInterest(UBUS_LAUNCHER_START_KEY_SWITCHER, sigc::mem_fun(this, &PanelMenuView::OnLauncherKeyNavStarted)); ubus_manager_.RegisterInterest(UBUS_LAUNCHER_END_KEY_SWITCHER, sigc::mem_fun(this, &PanelMenuView::OnLauncherKeyNavEnded)); ubus_manager_.RegisterInterest(UBUS_LAUNCHER_SELECTION_CHANGED, sigc::mem_fun(this, &PanelMenuView::OnLauncherSelectionChanged)); - - opacity_animator_.updated.connect(sigc::mem_fun(this, &PanelMenuView::OnFadeAnimatorUpdated)); - - opacity = 0.0f; - window_buttons_->opacity = 0.0f; - - Refresh(); - FullRedraw(); -} - -PanelMenuView::~PanelMenuView() -{ - style_changed_connection_.disconnect(); - window_buttons_->UnParentObject(); - titlebar_grab_area_->UnParentObject(); } void PanelMenuView::OverlayShown() diff --git a/panel/PanelMenuView.h b/panel/PanelMenuView.h index 82579612d..286af408a 100644 --- a/panel/PanelMenuView.h +++ b/panel/PanelMenuView.h @@ -73,6 +73,13 @@ protected: private: friend class TestPanelMenuView; + void SetupPanelMenuViewSignals(); + void SetupWindowButtons(); + void SetupLayout(); + void SetupTitlebarGrabArea(); + void SetupWindowManagerSignals(); + void SetupUBusManagerInterests(); + void OnActiveChanged(PanelIndicatorEntryView* view, bool is_active); void OnViewOpened(BamfMatcher* matcher, BamfView* view); void OnViewClosed(BamfMatcher* matcher, BamfView* view); diff --git a/tests/autopilot/unity/emulators/launcher.py b/tests/autopilot/unity/emulators/launcher.py index 636e986a3..c7f00f571 100644 --- a/tests/autopilot/unity/emulators/launcher.py +++ b/tests/autopilot/unity/emulators/launcher.py @@ -51,7 +51,7 @@ class LauncherController(UnityIntrospectionObject): @property def model(self): """Return the launcher model.""" - models = self.get_children_by_type(LauncherModel) + models = LauncherModel.get_all_instances() assert(len(models) == 1) return models[0] diff --git a/tests/autopilot/unity/tests/__init__.py b/tests/autopilot/unity/tests/__init__.py index 0d8d09c62..4d9cc64eb 100644 --- a/tests/autopilot/unity/tests/__init__.py +++ b/tests/autopilot/unity/tests/__init__.py @@ -32,12 +32,18 @@ from testtools.matchers import Equals from unittest.case import SkipTest from unity.emulators import ensure_unity_is_running +from unity.emulators.screen import Screen +from unity.emulators.dash import Dash +from unity.emulators.hud import Hud +from unity.emulators.launcher import LauncherController +from unity.emulators.panel import PanelController +from unity.emulators.switcher import Switcher +from unity.emulators.window_manager import WindowManager from unity.emulators.workspace import WorkspaceManager from unity.emulators.unity import ( set_log_severity, start_log_to_file, reset_logging, - Unity ) @@ -47,6 +53,9 @@ log = getLogger(__name__) class UnityTestCase(AutopilotTestCase): """Unity test case base class, with improvments specific to Unity tests.""" + def __init__(self, *args): + super(UnityTestCase, self).__init__(*args) + def setUp(self): super(UnityTestCase, self).setUp() try: @@ -82,19 +91,19 @@ class UnityTestCase(AutopilotTestCase): log.warning("Test changed the active workspace, changing it back...") self.workspace.switch_to(self._initial_workspace_num) # Have we left the dash open? - if not self.well_behaved(self.unity.dash, visible=False): + if not self.well_behaved(self.dash, visible=False): well_behaved = False reasons.append("The test left the dash open.") log.warning("Test left the dash open, closing it...") self.unity.dash.ensure_hidden() # ... or the hud? - if not self.well_behaved(self.unity.hud, visible=False): + if not self.well_behaved(self.hud, visible=False): well_behaved = False reasons.append("The test left the hud open.") log.warning("Test left the hud open, closing it...") self.hud.ensure_hidden() # Are we in show desktop mode? - if not self.well_behaved(self.unity.window_manager, showdesktop_active=False): + if not self.well_behaved(self.window_manager, showdesktop_active=False): well_behaved = False reasons.append("The test left the system in show_desktop mode.") log.warning("Test left the system in show desktop mode, exiting it...") @@ -107,15 +116,15 @@ class UnityTestCase(AutopilotTestCase): # exception. win = self.start_app_window('Calculator', locale='C') count = 1 - while self.unity.window_manager.showdesktop_active: + while self.window_manager.showdesktop_active: self.keybinding("window/show_desktop") sleep(count) count+=1 if count > 10: break win.close() - self.unity.window_manager.showdesktop_active.wait_for(False) - for launcher in self.unity.launcher.get_launchers(): + self.window_manager.showdesktop_active.wait_for(False) + for launcher in self.launcher.get_launchers(): if not self.well_behaved(launcher, in_keynav_mode=False): well_behaved = False reasons.append("The test left the launcher keynav mode enabled.") @@ -145,8 +154,46 @@ class UnityTestCase(AutopilotTestCase): return True @property - def unity(self): - return Unity.get_root_instance() + def screen(self): + if not getattr(self, '__screen', None): + self.__screen = self._get_screen() + return self.__screen + + @property + def dash(self): + if not getattr(self, '__dash', None): + self.__dash = Dash() + return self.__dash + + @property + def hud(self): + if not getattr(self, '__hud', None): + self.__hud = Hud(); + return self.__hud + + @property + def launcher(self): + if not getattr(self, '__launcher', None): + self.__launcher = self._get_launcher_controller() + return self.__launcher + + @property + def panels(self): + if not getattr(self, '__panels', None): + self.__panels = self._get_panel_controller() + return self.__panels + + @property + def switcher(self): + if not getattr(self, '__switcher', None): + self.__switcher = Switcher() + return self.__switcher + + @property + def window_manager(self): + if not getattr(self, '__window_manager', None): + self.__window_manager = self._get_window_manager() + return self.__window_manager @property def workspace(self): @@ -154,6 +201,26 @@ class UnityTestCase(AutopilotTestCase): self.__workspace = WorkspaceManager() return self.__workspace + def _get_screen(self): + screens = Screen.get_all_instances() + self.assertThat(len(screens), Equals(1)) + return screens[0] + + def _get_launcher_controller(self): + controllers = LauncherController.get_all_instances() + self.assertThat(len(controllers), Equals(1)) + return controllers[0] + + def _get_panel_controller(self): + controllers = PanelController.get_all_instances() + self.assertThat(len(controllers), Equals(1)) + return controllers[0] + + def _get_window_manager(self): + managers = WindowManager.get_all_instances() + self.assertThat(len(managers), Equals(1)) + return managers[0] + def _setUpUnityLogging(self): self._unity_log_file_name = mktemp(prefix=self.shortDescription()) start_log_to_file(self._unity_log_file_name) diff --git a/tests/autopilot/unity/tests/launcher/__init__.py b/tests/autopilot/unity/tests/launcher/__init__.py index 4d659c128..8f7602d92 100644 --- a/tests/autopilot/unity/tests/launcher/__init__.py +++ b/tests/autopilot/unity/tests/launcher/__init__.py @@ -56,4 +56,4 @@ class LauncherTestCase(UnityTestCase): def get_launcher(self): """Get the launcher for the current scenario.""" - return self.unity.launcher.get_launcher_for_monitor(self.launcher_monitor) + return self.launcher.get_launcher_for_monitor(self.launcher_monitor) diff --git a/tests/autopilot/unity/tests/launcher/test_capture.py b/tests/autopilot/unity/tests/launcher/test_capture.py index 844cd6721..6783301bf 100644 --- a/tests/autopilot/unity/tests/launcher/test_capture.py +++ b/tests/autopilot/unity/tests/launcher/test_capture.py @@ -37,7 +37,7 @@ class LauncherCaptureTests(UnityTestCase): def setHideMode(self, mode): self.set_unity_option('launcher_hide_mode', mode) - launcher = self.unity.launcher.get_launcher_for_monitor(0) + launcher = self.launcher.get_launcher_for_monitor(0) self.assertThat(launcher.hidemode, Eventually(Equals(mode))) def leftMostMonitor(self): diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py index d3a2266ac..e86db7b1e 100644 --- a/tests/autopilot/unity/tests/test_switcher.py +++ b/tests/autopilot/unity/tests/test_switcher.py @@ -238,8 +238,9 @@ class SwitcherTests(SwitcherTestCase): win = self.start_app_window("Text Editor") - self.unity.switcher.initiate(SwitcherMode.DETAIL) + self.unity.switcher.initiate() self.addCleanup(self.unity.switcher.terminate) + self.assertThat(self.unity.switcher.visible, Eventually(Equals(True))) self.keyboard.press_and_release("Alt+F4") # Need the sleep to allow the window time to close, for jenkins! diff --git a/tools/convert-files/compiz-profile-active-unity.convert b/tools/convert-files/compiz-profile-active-unity.convert index 7cc7e8f03..984f35a60 100644 --- a/tools/convert-files/compiz-profile-active-unity.convert +++ b/tools/convert-files/compiz-profile-active-unity.convert @@ -70,7 +70,7 @@ toggle-window-maximized-horizontally-key = /apps/compiz-1/plugins/core/screen0/o toggle-window-maximized-key = /apps/compiz-1/plugins/core/screen0/options/toggle_window_maximized_key toggle-window-maximized-vertically-key = /apps/compiz-1/plugins/core/screen0/options/toggle_window_maximized_vertically_key toggle-window-shaded-key = /apps/compiz-1/plugins/core/screen0/options/toggle_window_shaded_key -unmaximize-or-minimize-window-key = /apps/compiz-1/plugins/core/screen0/options/unmaximize_or_minimize_window_key +unmaximize-window-key = /apps/compiz-1/plugins/core/screen0/options/unmaximize_window_key window-menu-button = /apps/compiz-1/plugins/core/screen0/options/window_menu_button window-menu-key = /apps/compiz-1/plugins/core/screen0/options/window_menu_key diff --git a/tools/convert-files/compiz-profile-unity.convert b/tools/convert-files/compiz-profile-unity.convert index 57e75718d..5a8a5b240 100644 --- a/tools/convert-files/compiz-profile-unity.convert +++ b/tools/convert-files/compiz-profile-unity.convert @@ -70,7 +70,7 @@ toggle-window-maximized-horizontally-key = /apps/compizconfig-1/profiles/unity/p toggle-window-maximized-key = /apps/compizconfig-1/profiles/unity/plugins/core/screen0/options/toggle_window_maximized_key toggle-window-maximized-vertically-key = /apps/compizconfig-1/profiles/unity/plugins/core/screen0/options/toggle_window_maximized_vertically_key toggle-window-shaded-key = /apps/compizconfig-1/profiles/unity/plugins/core/screen0/options/toggle_window_shaded_key -unmaximize-or-minimize-window-key = /apps/compizconfig-1/profiles/unity/plugins/core/screen0/options/unmaximize_or_minimize_window_key +unmaximize-window-key = /apps/compizconfig-1/profiles/unity/plugins/core/screen0/options/unmaximize_window_key window-menu-button = /apps/compizconfig-1/profiles/unity/plugins/core/screen0/options/window_menu_button window-menu-key = /apps/compizconfig-1/profiles/unity/plugins/core/screen0/options/window_menu_key |
