summaryrefslogtreecommitdiff
diff options
-rw-r--r--dash/DashView.cpp1
-rw-r--r--debian/changelog19
-rw-r--r--debian/watch3
-rw-r--r--hud/HudView.cpp1
-rw-r--r--launcher/SwitcherController.cpp10
-rw-r--r--launcher/SwitcherController.h1
-rw-r--r--launcher/SwitcherControllerImpl.h1
-rw-r--r--plugins/unityshell/src/unityshell.cpp42
-rw-r--r--plugins/unityshell/src/unityshell.h1
-rw-r--r--tests/autopilot/unity/tests/test_dash.py2
-rw-r--r--tests/autopilot/unity/tests/test_ibus.py106
-rw-r--r--tests/autopilot/unity/tests/test_panel.py23
12 files changed, 175 insertions, 35 deletions
diff --git a/dash/DashView.cpp b/dash/DashView.cpp
index bf3079a6a..c5ef0e959 100644
--- a/dash/DashView.cpp
+++ b/dash/DashView.cpp
@@ -1525,6 +1525,7 @@ void DashView::AddProperties(GVariantBuilder* builder)
wrapper.add("bottom-border-height", style.GetDashBottomTileHeight());
wrapper.add("preview_displaying", preview_displaying_);
wrapper.add("dash_maximized", style.always_maximised());
+ wrapper.add("overlay_window_buttons_shown", overlay_window_buttons_->IsVisible());
}
nux::Area* DashView::KeyNavIteration(nux::KeyNavDirection direction)
diff --git a/debian/changelog b/debian/changelog
index 3ff1698c1..c5dee8b55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+unity (6.12.0daily13.02.26-0ubuntu1) raring; urgency=low
+
+ [ Andrea Azzarone ]
+ * Multi-monitor - Panel and launcher visible on top of multimonitor
+ non-focused fullscreen apps (LP: #748539)
+ * unity.tests.launcher.test_icon_behavior.LauncherIconsTests.* fails
+ randomly (LP: #1131679)
+
+ [ Xiao-Long Chen ]
+ * Add timeout before removing launcher (LP: #1119801)
+
+ [ MC Return ]
+ * cppcheck reports true positives (LP: #1131152)
+
+ [ Automatic PS uploader ]
+ * Automatic snapshot from revision 3171
+
+ -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Tue, 26 Feb 2013 04:02:40 +0000
+
unity (6.12.0daily13.02.19.1-0ubuntu1) raring; urgency=low
[ Brandon Schaefer ]
diff --git a/debian/watch b/debian/watch
index 8ef36d6e6..4fc0e423e 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,3 @@
version=3
-https://launchpad.net/unity/+download .*/unity-([0-9.]+)\.tar\.bz2
+opts=dversionmangle=s/daily.*// \
+ https://launchpad.net/unity/+download .*/unity-([0-9.]+)\.tar\.(?:xz|bz2|gz)
diff --git a/hud/HudView.cpp b/hud/HudView.cpp
index e0c08c72a..32d6e548e 100644
--- a/hud/HudView.cpp
+++ b/hud/HudView.cpp
@@ -557,6 +557,7 @@ void View::AddProperties(GVariantBuilder* builder)
variant::BuilderWrapper(builder)
.add(GetGeometry())
.add("selected_button", selected_button_)
+ .add("overlay_window_buttons_shown", overlay_window_buttons_->IsVisible())
.add("num_buttons", num_buttons);
}
diff --git a/launcher/SwitcherController.cpp b/launcher/SwitcherController.cpp
index 150a12a73..28bbc0c4f 100644
--- a/launcher/SwitcherController.cpp
+++ b/launcher/SwitcherController.cpp
@@ -139,6 +139,11 @@ SwitcherView::Ptr Controller::GetView() const
return impl_->GetView();
}
+bool Controller::IsDetailViewShown()
+{
+ return impl_->IsDetailViewShown();
+}
+
void Controller::SetDetail(bool value, unsigned int min_windows)
{
impl_->SetDetail(value, min_windows);
@@ -522,6 +527,11 @@ SwitcherView::Ptr Controller::Impl::GetView() const
return view_;
}
+bool Controller::Impl::IsDetailViewShown()
+{
+ return model_ && model_->detail_selection();
+}
+
void Controller::Impl::SetDetail(bool value, unsigned int min_windows)
{
if (value && model_->DetailXids().size() >= min_windows)
diff --git a/launcher/SwitcherController.h b/launcher/SwitcherController.h
index 29c5b7e7c..f291b7182 100644
--- a/launcher/SwitcherController.h
+++ b/launcher/SwitcherController.h
@@ -98,6 +98,7 @@ public:
void Select(int index);
+ bool IsDetailViewShown();
void SetDetail(bool detail,
unsigned int min_windows = 1);
diff --git a/launcher/SwitcherControllerImpl.h b/launcher/SwitcherControllerImpl.h
index 5734f1b05..9a877e5d0 100644
--- a/launcher/SwitcherControllerImpl.h
+++ b/launcher/SwitcherControllerImpl.h
@@ -56,6 +56,7 @@ struct Controller::Impl
void NextDetail();
void PrevDetail();
+ bool IsDetailViewShown();
void SetDetail(bool detail, unsigned int min_windows = 1);
void SelectFirstItem();
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 6f95f2721..b803551f9 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -624,7 +624,7 @@ void UnityScreen::setPanelShadowMatrix(const GLMatrix& matrix)
void UnityScreen::FillShadowRectForOutput(CompRect &shadowRect,
CompOutput *output)
{
- if (shadow_texture_.empty ())
+ if (_shadow_texture.empty ())
return;
float panel_h = static_cast<float>(panel_style_.panel_height);
@@ -1359,6 +1359,7 @@ bool UnityScreen::glPaintOutput(const GLScreenPaintAttrib& attrib,
// CompRegion has no clear() method. So this is the fastest alternative.
fullscreenRegion = CompRegion();
nuxRegion = CompRegion();
+ windows_for_monitor_.clear();
// bind the framebuffer if we plan to paint nux on this frame
if (doShellRepaint && BackgroundEffectHelper::HasDirtyHelpers())
@@ -2189,10 +2190,14 @@ bool UnityScreen::altTabNextWindowInitiate(CompAction* action, CompAction::State
switcher_controller_->Select((switcher_controller_->StartIndex())); // always select the current application
switcher_controller_->InitiateDetail();
}
- else
+ else if (switcher_controller_->IsDetailViewShown())
{
switcher_controller_->NextDetail();
}
+ else
+ {
+ switcher_controller_->SetDetail(true);
+ }
action->setState(action->state() | CompAction::StateTermKey);
return true;
@@ -2639,17 +2644,32 @@ bool UnityWindow::glPaint(const GLWindowPaintAttrib& attrib,
PAINT_WINDOW_TRANSLUCENT_MASK |
PAINT_WINDOW_TRANSFORMED_MASK |
PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
- if (!(mask & nonOcclusionBits) &&
- (window->state() & CompWindowStateFullscreenMask))
- // And I've been advised to test other things, but they don't work:
- // && (attrib.opacity == OPAQUE)) <-- Doesn't work; Only set in glDraw
- // && !window->alpha() <-- Doesn't work; Opaque windows often have alpha
+
+ if (window->isMapped() &&
+ window->defaultViewport() == uScreen->screen->vp())
{
- uScreen->fullscreenRegion += window->geometry();
- uScreen->fullscreenRegion -= uScreen->nuxRegion;
+ int monitor = window->outputDevice();
+
+ auto it = uScreen->windows_for_monitor_.find(monitor);
+
+ if (it != end(uScreen->windows_for_monitor_))
+ ++(it->second);
+ else
+ uScreen->windows_for_monitor_[monitor] = 1;
+
+ if (!(mask & nonOcclusionBits) &&
+ (window->state() & CompWindowStateFullscreenMask) &&
+ uScreen->windows_for_monitor_[monitor] == 1)
+ // And I've been advised to test other things, but they don't work:
+ // && (attrib.opacity == OPAQUE)) <-- Doesn't work; Only set in glDraw
+ // && !window->alpha() <-- Doesn't work; Opaque windows often have alpha
+ {
+ uScreen->fullscreenRegion += window->geometry();
+ }
+
+ if (uScreen->nuxRegion.isEmpty())
+ uScreen->firstWindowAboveShell = window;
}
- if (uScreen->nuxRegion.isEmpty())
- uScreen->firstWindowAboveShell = window;
}
GLWindowPaintAttrib wAttrib = attrib;
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index a5914ee78..defc9fa18 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -300,6 +300,7 @@ private:
typedef std::vector<CompActionPtr> ShortcutActions;
ShortcutActions _shortcut_actions;
std::map<CancelActionTarget, CompActionPtr> _escape_actions;
+ std::map<int, unsigned int> windows_for_monitor_;
/* keyboard-nav mode */
CompWindow* newFocusedWindow;
diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py
index f65b4963a..0e2cf2938 100644
--- a/tests/autopilot/unity/tests/test_dash.py
+++ b/tests/autopilot/unity/tests/test_dash.py
@@ -73,7 +73,7 @@ class DashRevealTests(DashTestCase):
"""Switch to command lens without closing the dash."""
self.unity.dash.ensure_visible()
self.unity.dash.reveal_command_lens()
- self.assertThat(self.unity.dash.visible, Eventually(Equals(False)))
+ self.assertThat(self.unity.dash.active_lens, Eventually(Equals('commands.lens')))
def test_alt_f4_close_dash(self):
"""Dash must close on alt+F4."""
diff --git a/tests/autopilot/unity/tests/test_ibus.py b/tests/autopilot/unity/tests/test_ibus.py
index eeb57707d..fd13d15b5 100644
--- a/tests/autopilot/unity/tests/test_ibus.py
+++ b/tests/autopilot/unity/tests/test_ibus.py
@@ -1,6 +1,6 @@
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
-# Author: Thomi Richards, Martin Mrazik
+# Authors: Thomi Richards, Martin Mrazik, Ɓukasz 'sil2100' Zemczak
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
@@ -23,6 +23,84 @@ from testtools.matchers import Equals, NotEquals
from unity.tests import UnityTestCase
+from gi.repository import GLib
+from gi.repository import IBus
+import time
+import dbus
+import threading
+
+
+# See lp:ibus-query
+class IBusQuery:
+ """A simple class allowing string queries to the IBus engine."""
+
+ def __init__(self):
+ self._bus = IBus.Bus()
+ self._dbusconn = dbus.connection.Connection(IBus.get_address())
+
+ # XXX: the new IBus bindings do not export create_input_context for
+ # introspection. This is troublesome - so, to workaround this problem
+ # we're directly fetching a new input context manually
+ ibus_obj = self._dbusconn.get_object(IBus.SERVICE_IBUS, IBus.PATH_IBUS)
+ self._test = dbus.Interface(ibus_obj, dbus_interface="org.freedesktop.IBus")
+ path = self._test.CreateInputContext("IBusQuery")
+ self._context = IBus.InputContext.new(path, self._bus.get_connection(), None)
+
+ self._glibloop = GLib.MainLoop()
+
+ self._context.connect("commit-text", self.__commit_text_cb)
+ self._context.connect("update-preedit-text", self.__update_preedit_cb)
+ self._context.connect("disabled", self.__disabled_cb)
+
+ self._context.set_capabilities (9)
+
+ def __commit_text_cb(self, context, text):
+ self.result += text.text
+ self._preedit = ''
+
+ def __update_preedit_cb(self, context, text, cursor_pos, visible):
+ if visible:
+ self._preedit = text.text
+
+ def __disabled_cb(self, a):
+ self.result += self._preedit
+ self._glibloop.quit()
+
+ def __abort(self):
+ self._abort = True
+
+ def poll(self, engine, ibus_input):
+ if len(ibus_input) <= 0:
+ return None
+
+ self.result = ''
+ self._preedit = ''
+ self._context.focus_in()
+ self._context.set_engine(engine)
+
+ # Timeout in case of the engine not being installed
+ self._abort = False
+ timeout = threading.Timer(4.0, self.__abort)
+ timeout.start()
+ while self._context.get_engine() is None:
+ if self._abort is True:
+ print "Error! Could not set the engine correctly."
+ return None
+ continue
+ timeout.cancel()
+
+ for c in ibus_input:
+ self._context.process_key_event(ord(c), 0, 0)
+
+ self._context.set_engine('')
+ self._context.focus_out()
+
+ GLib.timeout_add_seconds(5, lambda *args: self._glibloop.quit())
+ self._glibloop.run()
+
+ return unicode(self.result, "UTF-8")
+
+
class IBusTests(UnityTestCase):
"""Base class for IBus tests."""
@@ -30,6 +108,7 @@ class IBusTests(UnityTestCase):
def setUp(self):
super(IBusTests, self).setUp()
self.set_correct_ibus_trigger_keys()
+ self._ibus_query = None
def set_correct_ibus_trigger_keys(self):
"""Set the correct keys to trigger IBus.
@@ -68,6 +147,8 @@ class IBusTests(UnityTestCase):
"""
available_engines = get_available_input_engines()
+ if self._ibus_query is None:
+ self._ibus_query = IBusQuery()
if engine_name in available_engines:
if get_active_input_engines() != [engine_name]:
IBusTests._old_engines = set_active_engines([engine_name])
@@ -98,6 +179,11 @@ class IBusWidgetScenariodTests(IBusTests):
def do_ibus_test(self):
"""Do the basic IBus test on self.widget using self.input and self.result."""
+ try:
+ result = self.result
+ except:
+ result = self._ibus_query.poll(self.engine_name, self.input)
+
widget = getattr(self.unity, self.widget)
widget.ensure_visible()
self.addCleanup(widget.ensure_hidden)
@@ -107,7 +193,7 @@ class IBusWidgetScenariodTests(IBusTests):
if commit_key:
self.keyboard.press_and_release(commit_key)
self.deactivate_ibus(widget.searchbar)
- self.assertThat(widget.search_string, Eventually(Equals(self.result)))
+ self.assertThat(widget.search_string, Eventually(Equals(result)))
@@ -119,11 +205,11 @@ class IBusTestsPinyin(IBusWidgetScenariodTests):
scenarios = multiply_scenarios(
IBusWidgetScenariodTests.scenarios,
[
- ('basic', {'input': 'abc1', 'result': u'\u963f\u5e03\u4ece'}),
- ('photo', {'input': 'zhaopian ', 'result': u'\u7167\u7247'}),
- ('internet', {'input': 'hulianwang ', 'result': u'\u4e92\u8054\u7f51'}),
- ('disk', {'input': 'cipan ', 'result': u'\u78c1\u76d8'}),
- ('disk_management', {'input': 'cipan guanli ', 'result': u'\u78c1\u76d8\u7ba1\u7406'}),
+ ('basic', {'input': 'abc1'}),
+ ('photo', {'input': 'zhaopian '}),
+ ('internet', {'input': 'hulianwang '}),
+ ('disk', {'input': 'cipan '}),
+ ('disk_management', {'input': 'cipan guanli '}),
]
)
@@ -165,9 +251,9 @@ class IBusTestsAnthy(IBusWidgetScenariodTests):
scenarios = multiply_scenarios(
IBusWidgetScenariodTests.scenarios,
[
- ('system', {'input': 'shisutemu ', 'result': u'\u30b7\u30b9\u30c6\u30e0'}),
- ('game', {'input': 'ge-mu ', 'result': u'\u30b2\u30fc\u30e0'}),
- ('user', {'input': 'yu-za- ', 'result': u'\u30e6\u30fc\u30b6\u30fc'}),
+ ('system', {'input': 'shisutemu '}),
+ ('game', {'input': 'ge-mu '}),
+ ('user', {'input': 'yu-za- '}),
],
[
('commit_j', {'commit_key': 'Ctrl+j'}),
diff --git a/tests/autopilot/unity/tests/test_panel.py b/tests/autopilot/unity/tests/test_panel.py
index a8aeb1f98..94d53011b 100644
--- a/tests/autopilot/unity/tests/test_panel.py
+++ b/tests/autopilot/unity/tests/test_panel.py
@@ -295,8 +295,7 @@ class PanelWindowButtonsTests(PanelTestsBase):
self.unity.dash.ensure_visible()
self.addCleanup(self.unity.dash.ensure_hidden)
- self.assertThat(self.panel.window_buttons_shown, Eventually(Equals(True)))
- self.assertWinButtonsInOverlayMode(True)
+ self.assertThat(self.unity.dash.view.overlay_window_buttons_shown, Eventually(Equals(True)))
def test_window_buttons_work_in_dash_after_launcher_resize(self):
"""When the launcher icons are resized, the window
@@ -319,14 +318,13 @@ class PanelWindowButtonsTests(PanelTestsBase):
self.unity.hud.ensure_visible()
self.addCleanup(self.unity.hud.ensure_hidden)
- self.assertThat(self.panel.window_buttons_shown, Eventually(Equals(True)))
- self.assertWinButtonsInOverlayMode(True)
+ self.assertThat(self.unity.hud.view.overlay_window_buttons_shown, Eventually(Equals(True)))
def test_window_buttons_update_visual_state(self):
"""Window button must update its state in response to mouse events."""
- self.unity.hud.ensure_visible()
- self.addCleanup(self.unity.hud.ensure_hidden)
- button = self.panel.window_buttons.close
+ self.open_new_application_window("Text Editor", maximized=True, move_to_monitor=True)
+ self.panel.move_mouse_over_window_buttons()
+ button = self.panel.window_buttons.unmaximize
self.assertThat(button.visual_state, Eventually(Equals("normal")))
@@ -341,18 +339,17 @@ class PanelWindowButtonsTests(PanelTestsBase):
"""Window buttons must ignore clicks when the mouse released outside
their area.
"""
- self.unity.hud.ensure_visible()
- self.addCleanup(self.unity.hud.ensure_hidden)
+ win = self.open_new_application_window("Text Editor", maximized=True, move_to_monitor=True)
+ self.panel.move_mouse_over_window_buttons()
- button = self.panel.window_buttons.close
+ button = self.panel.window_buttons.unmaximize
button.mouse_move_to()
self.mouse.press()
self.assertThat(button.visual_state, Eventually(Equals("pressed")))
self.panel.move_mouse_below_the_panel()
self.mouse.release()
- self.assertThat(button.visual_state, Eventually(Equals("normal")))
- self.assertThat(self.unity.hud.visible, Eventually(Equals(True)))
+ self.assertThat(win.is_maximized, Equals(True))
def test_window_buttons_close_button_works_for_window(self):
"""Close window button must actually closes a window."""
@@ -959,6 +956,8 @@ class PanelIndicatorEntryTests(PanelTestsBase):
# This assert is for timing purposes only:
self.assertThat(menu_entry.active, Eventually(Equals(True)))
+ # Make sure we wait at least enough time that the menu appeared as well
+ sleep(self.panel.menus.fadein_duration / 1000.0)
self.mouse.click()
self.assertThat(menu_entry.active, Eventually(Equals(False)))