diff options
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | a11y/CMakeLists.txt | 48 | ||||
| -rw-r--r-- | a11y/nux-area-accessible.cpp (renamed from plugins/unityshell/src/nux-area-accessible.cpp) | 36 | ||||
| -rw-r--r-- | a11y/nux-area-accessible.h (renamed from plugins/unityshell/src/nux-area-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/nux-base-window-accessible.cpp (renamed from plugins/unityshell/src/nux-base-window-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/nux-base-window-accessible.h (renamed from plugins/unityshell/src/nux-base-window-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/nux-layout-accessible.cpp (renamed from plugins/unityshell/src/nux-layout-accessible.cpp) | 10 | ||||
| -rw-r--r-- | a11y/nux-layout-accessible.h (renamed from plugins/unityshell/src/nux-layout-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/nux-object-accessible.cpp (renamed from plugins/unityshell/src/nux-object-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/nux-object-accessible.h (renamed from plugins/unityshell/src/nux-object-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/nux-text-entry-accessible.cpp (renamed from plugins/unityshell/src/nux-text-entry-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/nux-text-entry-accessible.h (renamed from plugins/unityshell/src/nux-text-entry-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/nux-view-accessible.cpp (renamed from plugins/unityshell/src/nux-view-accessible.cpp) | 10 | ||||
| -rw-r--r-- | a11y/nux-view-accessible.h (renamed from plugins/unityshell/src/nux-view-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/pch/a11y_pch.hh | 33 | ||||
| -rw-r--r-- | a11y/unity-dash-view-accessible.cpp (renamed from plugins/unityshell/src/unity-dash-view-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-dash-view-accessible.h (renamed from plugins/unityshell/src/unity-dash-view-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-expander-view-accessible.cpp (renamed from plugins/unityshell/src/unity-expander-view-accessible.cpp) | 4 | ||||
| -rw-r--r-- | a11y/unity-expander-view-accessible.h (renamed from plugins/unityshell/src/unity-expander-view-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-filter-basic-button-accessible.cpp (renamed from plugins/unityshell/src/unity-filter-basic-button-accessible.cpp) | 5 | ||||
| -rw-r--r-- | a11y/unity-filter-basic-button-accessible.h (renamed from plugins/unityshell/src/unity-filter-basic-button-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-launcher-accessible.cpp (renamed from plugins/unityshell/src/unity-launcher-accessible.cpp) | 16 | ||||
| -rw-r--r-- | a11y/unity-launcher-accessible.h (renamed from plugins/unityshell/src/unity-launcher-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-launcher-icon-accessible.cpp (renamed from plugins/unityshell/src/unity-launcher-icon-accessible.cpp) | 4 | ||||
| -rw-r--r-- | a11y/unity-launcher-icon-accessible.h (renamed from plugins/unityshell/src/unity-launcher-icon-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-panel-view-accessible.cpp (renamed from plugins/unityshell/src/unity-panel-view-accessible.cpp) | 5 | ||||
| -rw-r--r-- | a11y/unity-panel-view-accessible.h (renamed from plugins/unityshell/src/unity-panel-view-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-places-group-accessible.cpp (renamed from plugins/unityshell/src/unity-places-group-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-places-group-accessible.h (renamed from plugins/unityshell/src/unity-places-group-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-quicklist-accessible.cpp (renamed from plugins/unityshell/src/unity-quicklist-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-quicklist-accessible.h (renamed from plugins/unityshell/src/unity-quicklist-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-quicklist-menu-accessible.cpp (renamed from plugins/unityshell/src/unity-quicklist-menu-accessible.cpp) | 10 | ||||
| -rw-r--r-- | a11y/unity-quicklist-menu-accessible.h (renamed from plugins/unityshell/src/unity-quicklist-menu-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-quicklist-menu-item-accessible.cpp (renamed from plugins/unityshell/src/unity-quicklist-menu-item-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-quicklist-menu-item-accessible.h (renamed from plugins/unityshell/src/unity-quicklist-menu-item-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-result-accessible.cpp (renamed from plugins/unityshell/src/unity-result-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-result-accessible.h (renamed from plugins/unityshell/src/unity-result-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-root-accessible.cpp (renamed from plugins/unityshell/src/unity-root-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-root-accessible.h (renamed from plugins/unityshell/src/unity-root-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-rvgrid-accessible.cpp (renamed from plugins/unityshell/src/unity-rvgrid-accessible.cpp) | 3 | ||||
| -rw-r--r-- | a11y/unity-rvgrid-accessible.h (renamed from plugins/unityshell/src/unity-rvgrid-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-scope-bar-icon-accessible.cpp (renamed from plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-scope-bar-icon-accessible.h (renamed from plugins/unityshell/src/unity-scope-bar-icon-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-sctext-accessible.cpp (renamed from plugins/unityshell/src/unity-sctext-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-sctext-accessible.h (renamed from plugins/unityshell/src/unity-sctext-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-search-bar-accessible.cpp (renamed from plugins/unityshell/src/unity-search-bar-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-search-bar-accessible.h (renamed from plugins/unityshell/src/unity-search-bar-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-session-button-accessible.cpp (renamed from plugins/unityshell/src/unity-session-button-accessible.cpp) | 3 | ||||
| -rw-r--r-- | a11y/unity-session-button-accessible.h (renamed from plugins/unityshell/src/unity-session-button-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-switcher-accessible.cpp (renamed from plugins/unityshell/src/unity-switcher-accessible.cpp) | 9 | ||||
| -rw-r--r-- | a11y/unity-switcher-accessible.h (renamed from plugins/unityshell/src/unity-switcher-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-text-input-accessible.cpp (renamed from plugins/unityshell/src/unity-text-input-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-text-input-accessible.h (renamed from plugins/unityshell/src/unity-text-input-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unity-util-accessible.cpp (renamed from plugins/unityshell/src/unity-util-accessible.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unity-util-accessible.h (renamed from plugins/unityshell/src/unity-util-accessible.h) | 0 | ||||
| -rw-r--r-- | a11y/unitya11y.cpp (renamed from plugins/unityshell/src/unitya11y.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unitya11y.h (renamed from plugins/unityshell/src/unitya11y.h) | 0 | ||||
| -rw-r--r-- | a11y/unitya11ytests.cpp (renamed from plugins/unityshell/src/unitya11ytests.cpp) | 0 | ||||
| -rw-r--r-- | a11y/unitya11ytests.h (renamed from plugins/unityshell/src/unitya11ytests.h) | 0 | ||||
| -rw-r--r-- | launcher/SwitcherController.cpp | 6 | ||||
| -rw-r--r-- | launcher/SwitcherModel.cpp | 58 | ||||
| -rw-r--r-- | launcher/SwitcherModel.h | 6 | ||||
| -rw-r--r-- | launcher/SwitcherView.cpp | 3 | ||||
| -rw-r--r-- | panel/PanelIndicatorEntryView.cpp | 20 | ||||
| -rw-r--r-- | plugins/unityshell/CMakeLists.txt | 46 | ||||
| -rw-r--r-- | plugins/unityshell/src/Monitor.cpp | 41 | ||||
| -rw-r--r-- | plugins/unityshell/src/Monitor.h | 46 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 5 | ||||
| -rw-r--r-- | resources/album_missing.png | bin | 1563 -> 622 bytes | |||
| -rw-r--r-- | resources/album_missing_preview.png | bin | 2836 -> 914 bytes | |||
| -rw-r--r-- | resources/category_gradient.png | bin | 6540 -> 4256 bytes | |||
| -rw-r--r-- | resources/category_gradient_no_refine.png | bin | 10585 -> 7356 bytes | |||
| -rw-r--r-- | resources/dash_bottom_border_tile.png | bin | 249 -> 211 bytes | |||
| -rw-r--r-- | resources/dash_bottom_border_tile_mask.png | bin | 159 -> 103 bytes | |||
| -rw-r--r-- | resources/dash_bottom_left_corner.png | bin | 1545 -> 707 bytes | |||
| -rw-r--r-- | resources/dash_bottom_left_corner_mask.png | bin | 261 -> 215 bytes | |||
| -rw-r--r-- | resources/dash_bottom_right_corner.png | bin | 1874 -> 1103 bytes | |||
| -rw-r--r-- | resources/dash_bottom_right_corner_mask.png | bin | 251 -> 175 bytes | |||
| -rw-r--r-- | resources/dash_group_expand.png | bin | 201 -> 155 bytes | |||
| -rw-r--r-- | resources/dash_group_unexpand.png | bin | 211 -> 169 bytes | |||
| -rw-r--r-- | resources/dash_left_tile.png | bin | 1082 -> 233 bytes | |||
| -rw-r--r-- | resources/dash_noise.png | bin | 31187 -> 23923 bytes | |||
| -rw-r--r-- | resources/dash_right_border_tile.png | bin | 243 -> 193 bytes | |||
| -rw-r--r-- | resources/dash_right_border_tile_mask.png | bin | 156 -> 104 bytes | |||
| -rw-r--r-- | resources/dash_sheen.png | bin | 11998 -> 5222 bytes | |||
| -rw-r--r-- | resources/dash_top_edge.png | bin | 415 -> 287 bytes | |||
| -rw-r--r-- | resources/dash_top_right_corner.png | bin | 1530 -> 735 bytes | |||
| -rw-r--r-- | resources/dash_top_right_corner_mask.png | bin | 266 -> 216 bytes | |||
| -rw-r--r-- | resources/dash_top_tile.png | bin | 1082 -> 200 bytes | |||
| -rw-r--r-- | resources/dialog_close.png | bin | 960 -> 658 bytes | |||
| -rw-r--r-- | resources/dialog_close_highlight.png | bin | 717 -> 627 bytes | |||
| -rw-r--r-- | resources/dialog_close_press.png | bin | 1062 -> 658 bytes | |||
| -rw-r--r-- | resources/hibernate.png | bin | 3152 -> 1440 bytes | |||
| -rw-r--r-- | resources/hibernate_highlight.png | bin | 3022 -> 1391 bytes | |||
| -rw-r--r-- | resources/launcher_bfb.png | bin | 13582 -> 9206 bytes | |||
| -rw-r--r-- | resources/launcher_icon_glow_62.png | bin | 650 -> 452 bytes | |||
| -rw-r--r-- | resources/launcher_pressure_effect.png | bin | 212 -> 197 bytes | |||
| -rw-r--r-- | resources/lock_icon.png | bin | 1094 -> 253 bytes | |||
| -rw-r--r-- | resources/lockscreen.png | bin | 2409 -> 992 bytes | |||
| -rw-r--r-- | resources/lockscreen_highlight.png | bin | 2273 -> 938 bytes | |||
| -rw-r--r-- | resources/logout.png | bin | 2933 -> 1191 bytes | |||
| -rw-r--r-- | resources/logout_highlight.png | bin | 2787 -> 1145 bytes | |||
| -rw-r--r-- | resources/panel-shadow.png | bin | 169 -> 159 bytes | |||
| -rw-r--r-- | resources/pattern_overlay.png | bin | 2813 -> 103 bytes | |||
| -rw-r--r-- | resources/places-tile-bg-tilable.png | bin | 176 -> 140 bytes | |||
| -rw-r--r-- | resources/refine_gradient_corner.png | bin | 994 -> 157 bytes | |||
| -rw-r--r-- | resources/refine_gradient_dash.png | bin | 27311 -> 15080 bytes | |||
| -rw-r--r-- | resources/refine_gradient_panel.png | bin | 2169 -> 1691 bytes | |||
| -rw-r--r-- | resources/refine_gradient_panel_single_column.png | bin | 141 -> 115 bytes | |||
| -rw-r--r-- | resources/restart.png | bin | 2927 -> 1325 bytes | |||
| -rw-r--r-- | resources/restart_highlight.png | bin | 2821 -> 1281 bytes | |||
| -rw-r--r-- | resources/round_corner_54x54.png | bin | 397 -> 279 bytes | |||
| -rw-r--r-- | resources/round_glow_62x62.png | bin | 954 -> 667 bytes | |||
| -rw-r--r-- | resources/round_glow_hl_62x62.png | bin | 1616 -> 1243 bytes | |||
| -rw-r--r-- | resources/round_shine_54x54.png | bin | 2340 -> 1763 bytes | |||
| -rw-r--r-- | resources/search_close.png | bin | 269 -> 203 bytes | |||
| -rw-r--r-- | resources/search_spin.png | bin | 493 -> 482 bytes | |||
| -rw-r--r-- | resources/shutdown.png | bin | 2909 -> 1283 bytes | |||
| -rw-r--r-- | resources/shutdown_highlight.png | bin | 2752 -> 1246 bytes | |||
| -rw-r--r-- | resources/squircle_base_selected_54.png | bin | 584 -> 405 bytes | |||
| -rw-r--r-- | resources/squircle_edge_54.png | bin | 1814 -> 1551 bytes | |||
| -rw-r--r-- | resources/squircle_shine_54.png | bin | 3471 -> 2773 bytes | |||
| -rw-r--r-- | resources/star_deselected.png | bin | 527 -> 453 bytes | |||
| -rw-r--r-- | resources/suspend.png | bin | 2895 -> 1225 bytes | |||
| -rw-r--r-- | resources/suspend_highlight.png | bin | 2759 -> 1167 bytes | |||
| -rw-r--r-- | resources/switcher_background.png | bin | 2191 -> 1248 bytes | |||
| -rw-r--r-- | resources/switcher_corner.png | bin | 757 -> 733 bytes | |||
| -rw-r--r-- | resources/switcher_left.png | bin | 308 -> 220 bytes | |||
| -rw-r--r-- | resources/switcher_top.png | bin | 291 -> 211 bytes | |||
| -rw-r--r-- | resources/video_missing.png | bin | 1465 -> 450 bytes | |||
| -rw-r--r-- | resources/warning_icon.png | bin | 1128 -> 313 bytes | |||
| -rw-r--r-- | shortcuts/AbstractShortcutHint.h | 3 | ||||
| -rw-r--r-- | shortcuts/CompizShortcutModeller.cpp | 10 | ||||
| -rw-r--r-- | shortcuts/MockShortcutHint.h | 3 | ||||
| -rw-r--r-- | shortcuts/ShortcutHint.cpp | 25 | ||||
| -rw-r--r-- | tests/test_layout_system.cpp | 62 | ||||
| -rw-r--r-- | tests/test_switcher_model.cpp | 19 | ||||
| -rwxr-xr-x | tools/unity.cmake | 4 | ||||
| -rw-r--r-- | unity-shared/GnomeKeyGrabber.cpp | 38 | ||||
| -rw-r--r-- | unity-shared/GnomeKeyGrabberImpl.h | 2 | ||||
| -rw-r--r-- | unity-shared/LayoutSystem.cpp | 3 | ||||
| -rw-r--r-- | unity-shared/LayoutSystem.h | 2 | ||||
| -rw-r--r-- | unity-shared/TextInput.cpp | 1 |
143 files changed, 374 insertions, 226 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f2312b3ae..d8da80363 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,6 +262,7 @@ pkg_check_modules (CACHED_UNITY_PRIVATE_DEPS REQUIRED ${UNITY_PROTOCOL_PRIVATE_D find_library (UNITY_PROTOCOL_PRIVATE_LIB unity-protocol-private ${CACHED_UNITY_PRIVATE_DEPS_LIBDIR} ${CACHED_UNITY_PRIVATE_DEPS_LIBRARY_DIRS}) set(UNITY_STANDALONE_LADD ${UNITY_STANDALONE_LADD} ${UNITY_PROTOCOL_PRIVATE_LIB}) +add_subdirectory(a11y) add_subdirectory(unity-shared) add_subdirectory(dash) add_subdirectory(launcher) diff --git a/a11y/CMakeLists.txt b/a11y/CMakeLists.txt new file mode 100644 index 000000000..9a4714d67 --- /dev/null +++ b/a11y/CMakeLists.txt @@ -0,0 +1,48 @@ +pkg_check_modules(A11Y_DEPS REQUIRED atk atk-bridge-2.0) + +set(CFLAGS + ${CACHED_UNITY_DEPS_CFLAGS} + ${CACHED_UNITY_DEPS_CFLAGS_OTHER} + ${PIC_FLAGS} + ${A11Y_DEPS_CFLAGS}) + +include_directories(.. ../unity-shared ../dash ../panel ../launcher ../shutdown ../plugins/unityshell/src ${CMAKE_BINARY_DIR}) + +string(REPLACE ";" " " CFLAGS "${CFLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CFLAGS}") +set(LIBS ${CACHED_UNITY_DEPS_LDFLAGS} ${A11Y_DEPS_LDFLAGS}) + +set(A11Y_SOURCES + nux-area-accessible.cpp + nux-base-window-accessible.cpp + nux-layout-accessible.cpp + nux-object-accessible.cpp + nux-text-entry-accessible.cpp + nux-view-accessible.cpp + unity-dash-view-accessible.cpp + unity-expander-view-accessible.cpp + unity-filter-basic-button-accessible.cpp + unity-launcher-accessible.cpp + unity-launcher-icon-accessible.cpp + unity-panel-view-accessible.cpp + unity-places-group-accessible.cpp + unity-quicklist-accessible.cpp + unity-quicklist-menu-accessible.cpp + unity-quicklist-menu-item-accessible.cpp + unity-result-accessible.cpp + unity-root-accessible.cpp + unity-rvgrid-accessible.cpp + unity-scope-bar-icon-accessible.cpp + unity-sctext-accessible.cpp + unity-search-bar-accessible.cpp + unity-session-button-accessible.cpp + unity-switcher-accessible.cpp + unity-text-input-accessible.cpp + unity-util-accessible.cpp + unitya11y.cpp + unitya11ytests.cpp +) + +add_library(a11y-lib STATIC ${A11Y_SOURCES}) +target_link_libraries(a11y-lib ${LIBS}) +add_pch(pch/a11y_pch.hh a11y-lib) diff --git a/plugins/unityshell/src/nux-area-accessible.cpp b/a11y/nux-area-accessible.cpp index 0e709596c..bffad5ad3 100644 --- a/plugins/unityshell/src/nux-area-accessible.cpp +++ b/a11y/nux-area-accessible.cpp @@ -173,13 +173,15 @@ nux_area_accessible_initialize(AtkObject* accessible, accessible->role = ATK_ROLE_UNKNOWN; nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible)); - area = dynamic_cast<nux::Area*>(nux_object); + area = static_cast<nux::Area*>(nux_object); /* focus support based on Focusable, used on the Dash */ area->key_nav_focus_change.connect(sigc::bind(sigc::ptr_fun(on_focus_changed_cb), accessible)); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS atk_component_add_focus_handler(ATK_COMPONENT(accessible), nux_area_accessible_focus_handler); +G_GNUC_END_IGNORE_DEPRECATIONS /* NOTE: we can't search for the parent window on initialization as a general rule, or we could enter an infinite loop. At area this @@ -204,11 +206,10 @@ nux_area_accessible_get_parent(AtkObject* obj) if (nux_object == NULL) /* defunct */ return NULL; - area = dynamic_cast<nux::Area*>(nux_object); - + area = static_cast<nux::Area*>(nux_object); parent = area->GetParentObject(); - return unity_a11y_get_accessible(parent); + return parent ? unity_a11y_get_accessible(parent) : NULL; } /* @@ -250,7 +251,7 @@ nux_area_accessible_ref_state_set(AtkObject* obj) if (nux_object == NULL) /* defunct */ return state_set; - area = dynamic_cast<nux::Area*>(nux_object); + area = static_cast<nux::Area*>(nux_object); if (area->IsSensitive()) { @@ -312,8 +313,7 @@ nux_area_accessible_get_extents(AtkComponent* component, if (nux_object == NULL) /* defunct */ return; - area = dynamic_cast<nux::Area*>(nux_object); - + area = static_cast<nux::Area*>(nux_object); geometry = area->GetGeometry(); *width = geometry.GetWidth(); @@ -349,8 +349,6 @@ nux_area_accessible_grab_focus(AtkComponent* component) if (nux_object == NULL) /* defunct */ return FALSE; - //area = dynamic_cast<nux::Area*>(nux_object); - /* FIXME: SetFocused doesn't return if the force was successful or not, we suppose that this is the case like in cally and gail */ @@ -450,14 +448,16 @@ gboolean nux_area_accessible_parent_window_active(NuxAreaAccessible* self) { AtkStateSet* state_set = NULL; + gboolean active = FALSE; check_parent_window_connected(self); - state_set = atk_object_ref_state_set(ATK_OBJECT(self->priv->parent_window)); - - gboolean active = atk_state_set_contains_state(state_set, ATK_STATE_ACTIVE); - - g_object_unref(state_set); + if (ATK_IS_OBJECT(self->priv->parent_window)) + { + state_set = atk_object_ref_state_set(ATK_OBJECT(self->priv->parent_window)); + active = atk_state_set_contains_state(state_set, ATK_STATE_ACTIVE); + g_object_unref(state_set); + } return active; } @@ -536,8 +536,8 @@ nux_area_accessible_real_check_pending_notification(NuxAreaAccessible* self) if (nux_object == NULL) /* defunct */ return FALSE; - g_signal_emit_by_name(self, "focus_event", self->priv->focused); - atk_focus_tracker_notify(ATK_OBJECT(self)); + g_signal_emit_by_name(self, "focus-event", self->priv->focused); + atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_FOCUSED, self->priv->focused); self->priv->pending_notification = FALSE; return TRUE; @@ -556,7 +556,7 @@ check_focus(NuxAreaAccessible* self) if (nux_object == NULL) /* defunct */ return; - area = dynamic_cast<nux::Area*>(nux_object); + area = static_cast<nux::Area*>(nux_object); if (nux::GetWindowCompositor().GetKeyFocusArea() == area) focus_in = TRUE; @@ -575,7 +575,7 @@ check_focus(NuxAreaAccessible* self) else { g_signal_emit_by_name(self, "focus_event", focus_in); - atk_focus_tracker_notify(ATK_OBJECT(self)); + atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_FOCUSED, focus_in); self->priv->pending_notification = FALSE; } } diff --git a/plugins/unityshell/src/nux-area-accessible.h b/a11y/nux-area-accessible.h index a5326c63f..a5326c63f 100644 --- a/plugins/unityshell/src/nux-area-accessible.h +++ b/a11y/nux-area-accessible.h diff --git a/plugins/unityshell/src/nux-base-window-accessible.cpp b/a11y/nux-base-window-accessible.cpp index e82b536d7..e82b536d7 100644 --- a/plugins/unityshell/src/nux-base-window-accessible.cpp +++ b/a11y/nux-base-window-accessible.cpp diff --git a/plugins/unityshell/src/nux-base-window-accessible.h b/a11y/nux-base-window-accessible.h index 0fa6382d4..0fa6382d4 100644 --- a/plugins/unityshell/src/nux-base-window-accessible.h +++ b/a11y/nux-base-window-accessible.h diff --git a/plugins/unityshell/src/nux-layout-accessible.cpp b/a11y/nux-layout-accessible.cpp index 398254fd4..d4a3e3b4a 100644 --- a/plugins/unityshell/src/nux-layout-accessible.cpp +++ b/a11y/nux-layout-accessible.cpp @@ -76,7 +76,7 @@ nux_layout_accessible_new(nux::Object* object) { AtkObject* accessible = NULL; - g_return_val_if_fail(dynamic_cast<nux::Layout*>(object), NULL); + g_return_val_if_fail(static_cast<nux::Layout*>(object), NULL); accessible = ATK_OBJECT(g_object_new(NUX_TYPE_LAYOUT_ACCESSIBLE, NULL)); @@ -98,7 +98,7 @@ nux_layout_accessible_initialize(AtkObject* accessible, accessible->role = ATK_ROLE_PANEL; nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible)); - layout = dynamic_cast<nux::Layout*>(nux_object); + layout = static_cast<nux::Layout*>(nux_object); layout->ViewAdded.connect(sigc::bind(sigc::ptr_fun(on_view_changed_cb), accessible, TRUE)); @@ -120,7 +120,7 @@ nux_layout_accessible_get_n_children(AtkObject* obj) if (!nux_object) /* state is defunct */ return 0; - layout = dynamic_cast<nux::Layout*>(nux_object); + layout = static_cast<nux::Layout*>(nux_object); element_list = layout->GetChildren(); @@ -148,14 +148,14 @@ nux_layout_accessible_ref_child(AtkObject* obj, if (!nux_object) /* state is defunct */ return 0; - layout = dynamic_cast<nux::Layout*>(nux_object); + layout = static_cast<nux::Layout*>(nux_object); element_list = layout->GetChildren(); it = element_list.begin(); std::advance(it, i); - child = dynamic_cast<nux::Object*>(*it); + child = static_cast<nux::Object*>(*it); child_accessible = unity_a11y_get_accessible(child); parent = atk_object_get_parent(child_accessible); diff --git a/plugins/unityshell/src/nux-layout-accessible.h b/a11y/nux-layout-accessible.h index cc9a50cd3..cc9a50cd3 100644 --- a/plugins/unityshell/src/nux-layout-accessible.h +++ b/a11y/nux-layout-accessible.h diff --git a/plugins/unityshell/src/nux-object-accessible.cpp b/a11y/nux-object-accessible.cpp index 4e25c2963..4e25c2963 100644 --- a/plugins/unityshell/src/nux-object-accessible.cpp +++ b/a11y/nux-object-accessible.cpp diff --git a/plugins/unityshell/src/nux-object-accessible.h b/a11y/nux-object-accessible.h index decf9b358..decf9b358 100644 --- a/plugins/unityshell/src/nux-object-accessible.h +++ b/a11y/nux-object-accessible.h diff --git a/plugins/unityshell/src/nux-text-entry-accessible.cpp b/a11y/nux-text-entry-accessible.cpp index bda50a611..bda50a611 100644 --- a/plugins/unityshell/src/nux-text-entry-accessible.cpp +++ b/a11y/nux-text-entry-accessible.cpp diff --git a/plugins/unityshell/src/nux-text-entry-accessible.h b/a11y/nux-text-entry-accessible.h index b618bd85a..b618bd85a 100644 --- a/plugins/unityshell/src/nux-text-entry-accessible.h +++ b/a11y/nux-text-entry-accessible.h diff --git a/plugins/unityshell/src/nux-view-accessible.cpp b/a11y/nux-view-accessible.cpp index 25c4944e6..2718437eb 100644 --- a/plugins/unityshell/src/nux-view-accessible.cpp +++ b/a11y/nux-view-accessible.cpp @@ -134,7 +134,7 @@ nux_view_accessible_initialize(AtkObject* accessible, accessible->role = ATK_ROLE_UNKNOWN; nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible)); - view = dynamic_cast<nux::View*>(nux_object); + view = static_cast<nux::View*>(nux_object); view->LayoutAdded.connect(sigc::bind(sigc::ptr_fun(on_layout_changed_cb), accessible, TRUE)); @@ -187,8 +187,7 @@ nux_view_accessible_get_n_children(AtkObject* obj) if (nux_object == NULL) /* state is defunct */ return 0; - view = dynamic_cast<nux::View*>(nux_object); - + view = static_cast<nux::View*>(nux_object); layout = view->GetLayout(); if (layout == NULL) @@ -216,8 +215,7 @@ nux_view_accessible_ref_child(AtkObject* obj, if (nux_object == NULL) /* state is defunct */ return 0; - view = dynamic_cast<nux::View*>(nux_object); - + view = static_cast<nux::View*>(nux_object); layout = view->GetLayout(); layout_accessible = unity_a11y_get_accessible(layout); @@ -297,7 +295,7 @@ nux_view_accessible_check_pending_notification(NuxAreaAccessible* area_accessibl return FALSE; g_signal_emit_by_name(self, "focus_event", self->priv->key_focused); - atk_focus_tracker_notify(ATK_OBJECT(self)); + atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_FOCUSED, self->priv->key_focused); self->priv->pending_notification = FALSE; return TRUE; diff --git a/plugins/unityshell/src/nux-view-accessible.h b/a11y/nux-view-accessible.h index bca728ce6..bca728ce6 100644 --- a/plugins/unityshell/src/nux-view-accessible.h +++ b/a11y/nux-view-accessible.h diff --git a/a11y/pch/a11y_pch.hh b/a11y/pch/a11y_pch.hh new file mode 100644 index 000000000..ecae45c9c --- /dev/null +++ b/a11y/pch/a11y_pch.hh @@ -0,0 +1,33 @@ +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- +/* + * Copyright (C) 2015 Canonical Ltd + * + * 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 by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * Authored by: Marco Trevisan <marco.trevisan@canonical.com> + */ + +/* + * These are the precompiled header includes for this module. + * Only system header files can be listed here. + */ + +#include <atk/atk.h> +#include <glib.h> +#include <gio/gio.h> +#include <gmodule.h> +#include <stdio.h> +#include <atk-bridge.h> +#include <Nux/Nux.h> +#include <Nux/WindowThread.h> +#include <NuxCore/Object.h> diff --git a/plugins/unityshell/src/unity-dash-view-accessible.cpp b/a11y/unity-dash-view-accessible.cpp index 76258e128..76258e128 100644 --- a/plugins/unityshell/src/unity-dash-view-accessible.cpp +++ b/a11y/unity-dash-view-accessible.cpp diff --git a/plugins/unityshell/src/unity-dash-view-accessible.h b/a11y/unity-dash-view-accessible.h index 9d3ef7cc1..9d3ef7cc1 100644 --- a/plugins/unityshell/src/unity-dash-view-accessible.h +++ b/a11y/unity-dash-view-accessible.h diff --git a/plugins/unityshell/src/unity-expander-view-accessible.cpp b/a11y/unity-expander-view-accessible.cpp index ba03d3f05..b16f5c3d2 100644 --- a/plugins/unityshell/src/unity-expander-view-accessible.cpp +++ b/a11y/unity-expander-view-accessible.cpp @@ -135,10 +135,8 @@ unity_expander_view_accessible_initialize(AtkObject* accessible, ATK_OBJECT_CLASS(unity_expander_view_accessible_parent_class)->initialize(accessible, data); object = (nux::Object*)data; - view = dynamic_cast<ExpanderView*>(object); - + view = static_cast<ExpanderView*>(object); view->key_nav_focus_change.connect(sigc::bind(sigc::ptr_fun(on_focus_changed_cb), accessible)); - view->expanded.changed.connect(sigc::bind(sigc::ptr_fun(on_expanded_changed_cb), accessible)); view->label.changed.connect(sigc::bind(sigc::ptr_fun(on_name_changed_cb), accessible)); diff --git a/plugins/unityshell/src/unity-expander-view-accessible.h b/a11y/unity-expander-view-accessible.h index 0c9855d79..0c9855d79 100644 --- a/plugins/unityshell/src/unity-expander-view-accessible.h +++ b/a11y/unity-expander-view-accessible.h diff --git a/plugins/unityshell/src/unity-filter-basic-button-accessible.cpp b/a11y/unity-filter-basic-button-accessible.cpp index a6fe8acbc..1011e86f5 100644 --- a/plugins/unityshell/src/unity-filter-basic-button-accessible.cpp +++ b/a11y/unity-filter-basic-button-accessible.cpp @@ -191,7 +191,7 @@ unity_filter_basic_button_accessible_ref_state_set(AtkObject* obj) if (nux_object == NULL) /* defunct */ return state_set; - button = dynamic_cast<FilterBasicButton*>(nux_object); + button = static_cast<FilterBasicButton*>(nux_object); atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE); atk_state_set_add_state(state_set, ATK_STATE_ENABLED); @@ -234,8 +234,7 @@ unity_filter_basic_button_accessible_do_action(AtkAction *action, if (nux_object == NULL) return FALSE; - button = dynamic_cast<FilterBasicButton*>(nux_object); - + button = static_cast<FilterBasicButton*>(nux_object); button->Activate(); return TRUE; diff --git a/plugins/unityshell/src/unity-filter-basic-button-accessible.h b/a11y/unity-filter-basic-button-accessible.h index a5eed8df0..a5eed8df0 100644 --- a/plugins/unityshell/src/unity-filter-basic-button-accessible.h +++ b/a11y/unity-filter-basic-button-accessible.h diff --git a/plugins/unityshell/src/unity-launcher-accessible.cpp b/a11y/unity-launcher-accessible.cpp index 2764a9d83..182ad524f 100644 --- a/plugins/unityshell/src/unity-launcher-accessible.cpp +++ b/a11y/unity-launcher-accessible.cpp @@ -156,8 +156,7 @@ unity_launcher_accessible_initialize(AtkObject* accessible, self = UNITY_LAUNCHER_ACCESSIBLE(accessible); nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible)); - launcher = dynamic_cast<Launcher*>(nux_object); - + launcher = static_cast<Launcher*>(nux_object); model = launcher->GetModel(); if (model) @@ -189,7 +188,7 @@ unity_launcher_accessible_get_n_children(AtkObject* obj) if (!object) /* state is defunct */ return 0; - launcher = dynamic_cast<Launcher*>(object); + launcher = static_cast<Launcher*>(object); launcher_model = launcher->GetModel(); @@ -220,8 +219,7 @@ unity_launcher_accessible_ref_child(AtkObject* obj, if (!nux_object) /* state is defunct */ return 0; - launcher = dynamic_cast<Launcher*>(nux_object); - + launcher = static_cast<Launcher*>(nux_object); launcher_model = launcher->GetModel(); it = launcher_model->begin(); @@ -298,7 +296,7 @@ unity_launcher_accessible_ref_selection(AtkSelection* selection, if (!nux_object) /* state is defunct */ return 0; - launcher = dynamic_cast<Launcher*>(nux_object); + launcher = static_cast<Launcher*>(nux_object); AbstractLauncherIcon::Ptr const& selected_icon = launcher->GetSelectedMenuIcon(); if (selected_icon) @@ -322,7 +320,7 @@ unity_launcher_accessible_get_selection_count(AtkSelection* selection) if (!nux_object) /* state is defunct */ return 0; - launcher = dynamic_cast<Launcher*>(nux_object); + launcher = static_cast<Launcher*>(nux_object); if (!launcher->GetSelectedMenuIcon()) return 0; @@ -344,7 +342,7 @@ unity_launcher_accessible_is_child_selected(AtkSelection* selection, if (!nux_object) /* state is defunct */ return 0; - launcher = dynamic_cast<Launcher*>(nux_object); + launcher = static_cast<Launcher*>(nux_object); LauncherModel::Ptr const& launcher_model = launcher->GetModel(); it = launcher_model->begin(); std::advance(it, i); @@ -428,7 +426,7 @@ update_children_index(UnityLauncherAccessible* self) if (!nux_object) /* state is defunct */ return; - launcher = dynamic_cast<Launcher*>(nux_object); + launcher = static_cast<Launcher*>(nux_object); launcher_model = launcher->GetModel(); if (launcher_model == NULL) diff --git a/plugins/unityshell/src/unity-launcher-accessible.h b/a11y/unity-launcher-accessible.h index faa9817a2..faa9817a2 100644 --- a/plugins/unityshell/src/unity-launcher-accessible.h +++ b/a11y/unity-launcher-accessible.h diff --git a/plugins/unityshell/src/unity-launcher-icon-accessible.cpp b/a11y/unity-launcher-icon-accessible.cpp index dff762d1c..8afb4e823 100644 --- a/plugins/unityshell/src/unity-launcher-icon-accessible.cpp +++ b/a11y/unity-launcher-icon-accessible.cpp @@ -245,8 +245,10 @@ unity_launcher_icon_accessible_initialize(AtkObject* accessible, accessible->role = ATK_ROLE_PUSH_BUTTON; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS atk_component_add_focus_handler(ATK_COMPONENT(accessible), unity_launcher_icon_accessible_focus_handler); +G_GNUC_END_IGNORE_DEPRECATIONS /* we could do that by redefining ->set_parent */ self->priv->on_parent_change_id = @@ -384,7 +386,7 @@ check_selected(UnityLauncherIconAccessible* self) found); g_signal_emit_by_name(self, "focus-event", self->priv->selected, &return_val); - atk_focus_tracker_notify(ATK_OBJECT(self)); + atk_object_notify_state_change(ATK_OBJECT(self), ATK_STATE_FOCUSED, self->priv->selected); } } diff --git a/plugins/unityshell/src/unity-launcher-icon-accessible.h b/a11y/unity-launcher-icon-accessible.h index 94cd7cc13..94cd7cc13 100644 --- a/plugins/unityshell/src/unity-launcher-icon-accessible.h +++ b/a11y/unity-launcher-icon-accessible.h diff --git a/plugins/unityshell/src/unity-panel-view-accessible.cpp b/a11y/unity-panel-view-accessible.cpp index 688089f70..4b23e7e4c 100644 --- a/plugins/unityshell/src/unity-panel-view-accessible.cpp +++ b/a11y/unity-panel-view-accessible.cpp @@ -28,13 +28,14 @@ * */ +#include "config.h" +#include "unitya11y.h" + #include <glib/gi18n-lib.h> #include <Nux/Nux.h> #include "PanelView.h" #include "unity-panel-view-accessible.h" -#include "unitya11y.h" - using namespace unity::panel; /* GObject */ diff --git a/plugins/unityshell/src/unity-panel-view-accessible.h b/a11y/unity-panel-view-accessible.h index dcca2e899..dcca2e899 100644 --- a/plugins/unityshell/src/unity-panel-view-accessible.h +++ b/a11y/unity-panel-view-accessible.h diff --git a/plugins/unityshell/src/unity-places-group-accessible.cpp b/a11y/unity-places-group-accessible.cpp index 8abfe78fa..8abfe78fa 100644 --- a/plugins/unityshell/src/unity-places-group-accessible.cpp +++ b/a11y/unity-places-group-accessible.cpp diff --git a/plugins/unityshell/src/unity-places-group-accessible.h b/a11y/unity-places-group-accessible.h index 594c9a219..594c9a219 100644 --- a/plugins/unityshell/src/unity-places-group-accessible.h +++ b/a11y/unity-places-group-accessible.h diff --git a/plugins/unityshell/src/unity-quicklist-accessible.cpp b/a11y/unity-quicklist-accessible.cpp index eaebd8bf4..eaebd8bf4 100644 --- a/plugins/unityshell/src/unity-quicklist-accessible.cpp +++ b/a11y/unity-quicklist-accessible.cpp diff --git a/plugins/unityshell/src/unity-quicklist-accessible.h b/a11y/unity-quicklist-accessible.h index e1a30b85c..e1a30b85c 100644 --- a/plugins/unityshell/src/unity-quicklist-accessible.h +++ b/a11y/unity-quicklist-accessible.h diff --git a/plugins/unityshell/src/unity-quicklist-menu-accessible.cpp b/a11y/unity-quicklist-menu-accessible.cpp index 5a73fb021..8967b4738 100644 --- a/plugins/unityshell/src/unity-quicklist-menu-accessible.cpp +++ b/a11y/unity-quicklist-menu-accessible.cpp @@ -269,10 +269,14 @@ unity_quicklist_menu_accessible_ref_selection(AtkSelection* selection, return NULL; child = quicklist->GetSelectedMenuItem(); - child_accessible = unity_a11y_get_accessible(child); - if (child_accessible != NULL) - g_object_ref(child_accessible); + if (child != NULL) + { + child_accessible = unity_a11y_get_accessible(child); + + if (child_accessible != NULL) + g_object_ref(child_accessible); + } return child_accessible; } diff --git a/plugins/unityshell/src/unity-quicklist-menu-accessible.h b/a11y/unity-quicklist-menu-accessible.h index 99aeab75a..99aeab75a 100644 --- a/plugins/unityshell/src/unity-quicklist-menu-accessible.h +++ b/a11y/unity-quicklist-menu-accessible.h diff --git a/plugins/unityshell/src/unity-quicklist-menu-item-accessible.cpp b/a11y/unity-quicklist-menu-item-accessible.cpp index 97bc898cc..97bc898cc 100644 --- a/plugins/unityshell/src/unity-quicklist-menu-item-accessible.cpp +++ b/a11y/unity-quicklist-menu-item-accessible.cpp diff --git a/plugins/unityshell/src/unity-quicklist-menu-item-accessible.h b/a11y/unity-quicklist-menu-item-accessible.h index 5c0c2b3b1..5c0c2b3b1 100644 --- a/plugins/unityshell/src/unity-quicklist-menu-item-accessible.h +++ b/a11y/unity-quicklist-menu-item-accessible.h diff --git a/plugins/unityshell/src/unity-result-accessible.cpp b/a11y/unity-result-accessible.cpp index b2f431e18..b2f431e18 100644 --- a/plugins/unityshell/src/unity-result-accessible.cpp +++ b/a11y/unity-result-accessible.cpp diff --git a/plugins/unityshell/src/unity-result-accessible.h b/a11y/unity-result-accessible.h index 764a4c70c..764a4c70c 100644 --- a/plugins/unityshell/src/unity-result-accessible.h +++ b/a11y/unity-result-accessible.h diff --git a/plugins/unityshell/src/unity-root-accessible.cpp b/a11y/unity-root-accessible.cpp index 92dd63cd9..92dd63cd9 100644 --- a/plugins/unityshell/src/unity-root-accessible.cpp +++ b/a11y/unity-root-accessible.cpp diff --git a/plugins/unityshell/src/unity-root-accessible.h b/a11y/unity-root-accessible.h index 4e843e1df..4e843e1df 100644 --- a/plugins/unityshell/src/unity-root-accessible.h +++ b/a11y/unity-root-accessible.h diff --git a/plugins/unityshell/src/unity-rvgrid-accessible.cpp b/a11y/unity-rvgrid-accessible.cpp index d56a275c7..e17f15e2a 100644 --- a/plugins/unityshell/src/unity-rvgrid-accessible.cpp +++ b/a11y/unity-rvgrid-accessible.cpp @@ -158,8 +158,7 @@ check_selection(UnityRvgridAccessible* self) if (!object) /* state is defunct */ return; - rvgrid = dynamic_cast<ResultViewGrid*>(object); - + rvgrid = static_cast<ResultViewGrid*>(object); index = rvgrid->GetSelectedIndex(); if (index >= 0) diff --git a/plugins/unityshell/src/unity-rvgrid-accessible.h b/a11y/unity-rvgrid-accessible.h index bd9cc0fb0..bd9cc0fb0 100644 --- a/plugins/unityshell/src/unity-rvgrid-accessible.h +++ b/a11y/unity-rvgrid-accessible.h diff --git a/plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp b/a11y/unity-scope-bar-icon-accessible.cpp index 997e9364d..997e9364d 100644 --- a/plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp +++ b/a11y/unity-scope-bar-icon-accessible.cpp diff --git a/plugins/unityshell/src/unity-scope-bar-icon-accessible.h b/a11y/unity-scope-bar-icon-accessible.h index 6fa67f160..6fa67f160 100644 --- a/plugins/unityshell/src/unity-scope-bar-icon-accessible.h +++ b/a11y/unity-scope-bar-icon-accessible.h diff --git a/plugins/unityshell/src/unity-sctext-accessible.cpp b/a11y/unity-sctext-accessible.cpp index b1f043215..b1f043215 100644 --- a/plugins/unityshell/src/unity-sctext-accessible.cpp +++ b/a11y/unity-sctext-accessible.cpp diff --git a/plugins/unityshell/src/unity-sctext-accessible.h b/a11y/unity-sctext-accessible.h index 2c1dd22c8..2c1dd22c8 100644 --- a/plugins/unityshell/src/unity-sctext-accessible.h +++ b/a11y/unity-sctext-accessible.h diff --git a/plugins/unityshell/src/unity-search-bar-accessible.cpp b/a11y/unity-search-bar-accessible.cpp index 4c59cdc81..4c59cdc81 100644 --- a/plugins/unityshell/src/unity-search-bar-accessible.cpp +++ b/a11y/unity-search-bar-accessible.cpp diff --git a/plugins/unityshell/src/unity-search-bar-accessible.h b/a11y/unity-search-bar-accessible.h index 94664b77e..94664b77e 100644 --- a/plugins/unityshell/src/unity-search-bar-accessible.h +++ b/a11y/unity-search-bar-accessible.h diff --git a/plugins/unityshell/src/unity-session-button-accessible.cpp b/a11y/unity-session-button-accessible.cpp index 62ec0b8ed..65653ef73 100644 --- a/plugins/unityshell/src/unity-session-button-accessible.cpp +++ b/a11y/unity-session-button-accessible.cpp @@ -153,8 +153,7 @@ unity_session_button_accessible_initialize(AtkObject* accessible, if (nux_object == NULL) /* defunct */ return; - button = dynamic_cast<Button*>(nux_object); - + button = static_cast<Button*>(nux_object); button->highlighted.changed.connect(sigc::bind(sigc::ptr_fun(on_focus_change_cb), UNITY_SESSION_BUTTON_ACCESSIBLE(self))); } diff --git a/plugins/unityshell/src/unity-session-button-accessible.h b/a11y/unity-session-button-accessible.h index ab3ae0429..ab3ae0429 100644 --- a/plugins/unityshell/src/unity-session-button-accessible.h +++ b/a11y/unity-session-button-accessible.h diff --git a/plugins/unityshell/src/unity-switcher-accessible.cpp b/a11y/unity-switcher-accessible.cpp index ab83d6477..80651bc01 100644 --- a/plugins/unityshell/src/unity-switcher-accessible.cpp +++ b/a11y/unity-switcher-accessible.cpp @@ -292,8 +292,7 @@ unity_switcher_accessible_ref_selection(AtkSelection* selection, if (!nux_object) /* state is defunct */ return 0; - switcher = dynamic_cast<SwitcherView*>(nux_object); - + switcher = static_cast<SwitcherView*>(nux_object); switcher_model = switcher->GetModel(); selected_index = switcher_model->SelectionIndex(); @@ -319,7 +318,7 @@ unity_switcher_accessible_get_selection_count(AtkSelection* selection) if (!nux_object) /* state is defunct */ return 0; - switcher = dynamic_cast<SwitcherView*>(nux_object); + switcher = static_cast<SwitcherView*>(nux_object); switcher_model = switcher->GetModel(); if (!switcher_model->Selection()) @@ -344,7 +343,7 @@ unity_switcher_accessible_is_child_selected(AtkSelection* selection, if (!nux_object) /* state is defunct */ return 0; - switcher = dynamic_cast<SwitcherView*>(nux_object); + switcher = static_cast<SwitcherView*>(nux_object); switcher_model = switcher->GetModel(); selected_index = switcher_model->SelectionIndex(); @@ -393,7 +392,7 @@ create_children(UnitySwitcherAccessible* self) if (!nux_object) /* state is defunct */ return; - switcher = dynamic_cast<SwitcherView*>(nux_object); + switcher = static_cast<SwitcherView*>(nux_object); SwitcherModel::Ptr const& switcher_model = switcher->GetModel(); if (!switcher_model) diff --git a/plugins/unityshell/src/unity-switcher-accessible.h b/a11y/unity-switcher-accessible.h index b79d0683a..b79d0683a 100644 --- a/plugins/unityshell/src/unity-switcher-accessible.h +++ b/a11y/unity-switcher-accessible.h diff --git a/plugins/unityshell/src/unity-text-input-accessible.cpp b/a11y/unity-text-input-accessible.cpp index 57d1a490a..57d1a490a 100644 --- a/plugins/unityshell/src/unity-text-input-accessible.cpp +++ b/a11y/unity-text-input-accessible.cpp diff --git a/plugins/unityshell/src/unity-text-input-accessible.h b/a11y/unity-text-input-accessible.h index c1ab85636..c1ab85636 100644 --- a/plugins/unityshell/src/unity-text-input-accessible.h +++ b/a11y/unity-text-input-accessible.h diff --git a/plugins/unityshell/src/unity-util-accessible.cpp b/a11y/unity-util-accessible.cpp index b850cd2ea..b850cd2ea 100644 --- a/plugins/unityshell/src/unity-util-accessible.cpp +++ b/a11y/unity-util-accessible.cpp diff --git a/plugins/unityshell/src/unity-util-accessible.h b/a11y/unity-util-accessible.h index 8ed12d037..8ed12d037 100644 --- a/plugins/unityshell/src/unity-util-accessible.h +++ b/a11y/unity-util-accessible.h diff --git a/plugins/unityshell/src/unitya11y.cpp b/a11y/unitya11y.cpp index bcd670f5a..bcd670f5a 100644 --- a/plugins/unityshell/src/unitya11y.cpp +++ b/a11y/unitya11y.cpp diff --git a/plugins/unityshell/src/unitya11y.h b/a11y/unitya11y.h index 37b81e515..37b81e515 100644 --- a/plugins/unityshell/src/unitya11y.h +++ b/a11y/unitya11y.h diff --git a/plugins/unityshell/src/unitya11ytests.cpp b/a11y/unitya11ytests.cpp index efc7968ca..efc7968ca 100644 --- a/plugins/unityshell/src/unitya11ytests.cpp +++ b/a11y/unitya11ytests.cpp diff --git a/plugins/unityshell/src/unitya11ytests.h b/a11y/unitya11ytests.h index cfb3631b3..cfb3631b3 100644 --- a/plugins/unityshell/src/unitya11ytests.h +++ b/a11y/unitya11ytests.h diff --git a/launcher/SwitcherController.cpp b/launcher/SwitcherController.cpp index c441a63b9..9b9711218 100644 --- a/launcher/SwitcherController.cpp +++ b/launcher/SwitcherController.cpp @@ -167,7 +167,7 @@ void Controller::Impl::CloseSelection() { // Using model_->Selection()->Close() would be nicer, but it wouldn't take // in consideration the workspace related settings - for (auto window : model_->DetailXids()) + for (auto window : model_->SelectionWindows()) WindowManager::Default().Close(window); } } @@ -576,7 +576,7 @@ SwitcherView::Ptr Controller::Impl::GetView() const void Controller::Impl::SetDetail(bool value, unsigned int min_windows) { - if (value && model_->Selection()->AllowDetailViewInSwitcher() && model_->DetailXids().size() >= min_windows) + if (value && model_->Selection()->AllowDetailViewInSwitcher() && model_->SelectionWindows().size() >= min_windows) { model_->detail_selection = true; obj_->detail_mode_ = DetailMode::TAB_NEXT_WINDOW; @@ -680,7 +680,7 @@ Selection Controller::Impl::GetCurrentSelection() const } else if (model_->SelectionIsActive()) { - window = model_->DetailXids().front(); + window = model_->SelectionWindows().front(); } } } diff --git a/launcher/SwitcherModel.cpp b/launcher/SwitcherModel.cpp index 2b17d0da4..df3264328 100644 --- a/launcher/SwitcherModel.cpp +++ b/launcher/SwitcherModel.cpp @@ -83,6 +83,10 @@ SwitcherModel::SwitcherModel(Applications const& icons, bool sort_by_priority) only_apps_on_viewport.changed.connect([this] (bool) { VerifyApplications(); }); + + detail_selection.changed.connect([this] (bool) { + UpdateDetailXids(); + }); } void SwitcherModel::UpdateLastActiveApplication() @@ -165,7 +169,7 @@ void SwitcherModel::InsertIcon(AbstractLauncherIcon::Ptr const& application) void SwitcherModel::ConnectToIconSignals(launcher::AbstractLauncherIcon::Ptr const& icon) { icon->quirks_changed.connect(sigc::hide(sigc::hide(sigc::mem_fun(this, &SwitcherModel::OnIconQuirksChanged)))); - icon->windows_changed.connect(sigc::hide(sigc::mem_fun(&updated, &decltype(updated)::emit))); + icon->windows_changed.connect(sigc::hide(sigc::bind(sigc::mem_fun(this, &SwitcherModel::OnIconWindowsUpdated), icon.GetPointer()))); } void SwitcherModel::AddIcon(AbstractLauncherIcon::Ptr const& icon) @@ -232,6 +236,19 @@ void SwitcherModel::OnIconQuirksChanged() selection_changed.emit(new_selection); } +void SwitcherModel::OnIconWindowsUpdated(AbstractLauncherIcon* icon) +{ + if (detail_selection() && icon == Selection().GetPointer()) + { + UpdateDetailXids(); + + if (detail_selection_index() >= detail_xids_.size()) + detail_selection_index = detail_xids_.empty() ? 0 : detail_xids_.size() - 1; + } + + updated.emit(); +} + std::string SwitcherModel::GetName() const { return "SwitcherModel"; @@ -242,8 +259,8 @@ void SwitcherModel::AddProperties(debug::IntrospectionData& introspection) introspection .add("detail-selection", detail_selection) .add("detail-selection-index", detail_selection_index()) - .add("detail-current-count", DetailXids().size()) - .add("detail-windows", glib::Variant::FromVector(DetailXids())) + .add("detail-current-count", SelectionWindows().size()) + .add("detail-windows", glib::Variant::FromVector(SelectionWindows())) .add("only-apps-on-viewport", only_apps_on_viewport()) .add("selection-index", SelectionIndex()) .add("last-selection-index", LastSelectionIndex()); @@ -324,8 +341,16 @@ int SwitcherModel::LastSelectionIndex() const return last_index_; } -std::vector<Window> SwitcherModel::DetailXids() const +std::vector<Window> const& SwitcherModel::DetailXids() const { + return detail_xids_; +} + +std::vector<Window> SwitcherModel::SelectionWindows() const +{ + if (!detail_xids_.empty()) + return detail_xids_; + WindowManager& wm = WindowManager::Default(); std::vector<Window> results; @@ -353,16 +378,23 @@ std::vector<Window> SwitcherModel::DetailXids() const return results; } +void SwitcherModel::UpdateDetailXids() +{ + detail_xids_.clear(); + + if (detail_selection) + detail_xids_ = SelectionWindows(); +} + Window SwitcherModel::DetailSelectionWindow() const { - auto windows = DetailXids(); - if (!detail_selection || windows.empty()) + if (!detail_selection || detail_xids_.empty()) return 0; - if (detail_selection_index > windows.size() - 1) + if (detail_selection_index > detail_xids_.size() - 1) return 0; - return windows[detail_selection_index]; + return detail_xids_[detail_selection_index]; } void SwitcherModel::UnsetDetailSelection() @@ -403,7 +435,7 @@ void SwitcherModel::NextDetail() if (!detail_selection()) return; - detail_selection_index = (detail_selection_index + 1) % DetailXids().size(); + detail_selection_index = (detail_selection_index + 1) % detail_xids_.size(); UpdateRowIndex(); } @@ -412,7 +444,7 @@ void SwitcherModel::PrevDetail() if (!detail_selection()) return; - detail_selection_index = ((detail_selection_index() > 0) ? detail_selection_index : DetailXids().size()) - 1; + detail_selection_index = ((detail_selection_index() > 0) ? detail_selection_index : detail_xids_.size()) - 1; UpdateRowIndex(); } @@ -471,7 +503,7 @@ void SwitcherModel::NextDetailRow() } else { - detail_selection_index = (detail_selection_index + 1) % DetailXids().size(); + detail_selection_index = (detail_selection_index + 1) % detail_xids_.size(); } } @@ -491,13 +523,13 @@ void SwitcherModel::PrevDetailRow() } else { - detail_selection_index = ((detail_selection_index() > 0) ? detail_selection_index : DetailXids().size()) - 1; + detail_selection_index = ((detail_selection_index() > 0) ? detail_selection_index : detail_xids_.size()) - 1; } } bool SwitcherModel::HasNextDetailRow() const { - return (detail_selection_index() < DetailXids().size() - 1); + return (detail_selection_index() < detail_xids_.size() - 1); } bool SwitcherModel::HasPrevDetailRow() const diff --git a/launcher/SwitcherModel.h b/launcher/SwitcherModel.h index 4ec7ca43c..1fea03204 100644 --- a/launcher/SwitcherModel.h +++ b/launcher/SwitcherModel.h @@ -84,7 +84,8 @@ public: launcher::AbstractLauncherIcon::Ptr LastSelection() const; int LastSelectionIndex() const; - std::vector<Window> DetailXids() const; + std::vector<Window> SelectionWindows() const; + std::vector<Window> const& DetailXids() const; Window DetailSelectionWindow() const; void Next(); @@ -120,7 +121,9 @@ private: void ConnectToIconSignals(launcher::AbstractLauncherIcon::Ptr const&); void VerifyApplications(); void UpdateLastActiveApplication(); + void UpdateDetailXids(); void OnIconQuirksChanged(); + void OnIconWindowsUpdated(launcher::AbstractLauncherIcon*); void UnsetDetailSelection(); void NextIndex(); @@ -134,6 +137,7 @@ private: unsigned int row_index_; launcher::AbstractLauncherIcon::Ptr last_active_application_; std::vector<int> row_sizes_; + std::vector<Window> detail_xids_; }; } diff --git a/launcher/SwitcherView.cpp b/launcher/SwitcherView.cpp index 3419ee467..b81eeef5d 100644 --- a/launcher/SwitcherView.cpp +++ b/launcher/SwitcherView.cpp @@ -604,8 +604,9 @@ nux::Geometry SwitcherView::UpdateRenderTargets(float progress) for (Window window : xids) { - auto layout_window = std::make_shared<LayoutWindow>(window); bool selected = (window == model_->DetailSelectionWindow()); + auto layout_window = std::make_shared<LayoutWindow>(window); + layout_window->ComputeDecorationHeight(); layout_window->selected = selected; layout_window->alpha = (selected ? 1.0f : 0.9f) * progress; diff --git a/panel/PanelIndicatorEntryView.cpp b/panel/PanelIndicatorEntryView.cpp index b4f75f1c4..16a682a9f 100644 --- a/panel/PanelIndicatorEntryView.cpp +++ b/panel/PanelIndicatorEntryView.cpp @@ -40,6 +40,7 @@ namespace { DECLARE_LOGGER(logger, "unity.panel.indicator.entry"); const int DEFAULT_SPACING = 3; +const std::string IMAGE_MISSING = "image-missing"; } using namespace indicator; @@ -203,8 +204,12 @@ void PanelIndicatorEntryView::SetActiveState(bool active, int button) glib::Object<GdkPixbuf> PanelIndicatorEntryView::MakePixbuf(int size) { glib::Object<GdkPixbuf> pixbuf; - auto image_type = proxy_->image_type(); + // see if we need to do anything + if (!proxy_->image_visible() || proxy_->image_data().empty()) + return pixbuf; + + auto image_type = proxy_->image_type(); switch (image_type) { case GTK_IMAGE_PIXBUF: @@ -247,6 +252,11 @@ glib::Object<GdkPixbuf> PanelIndicatorEntryView::MakePixbuf(int size) { auto* filename = gtk_icon_info_get_filename(info); pixbuf = gdk_pixbuf_new_from_file_at_size(filename, -1, size, nullptr); + // if that failed, whine and load fallback + if (!pixbuf) + { + LOG_WARN(logger) << "failed to load: " << filename; + } } else if (image_type == GTK_IMAGE_ICON_NAME) { @@ -257,6 +267,14 @@ glib::Object<GdkPixbuf> PanelIndicatorEntryView::MakePixbuf(int size) } } + // have a generic fallback pixbuf if for whatever reason icon loading + // failed (see LP: #1525186) + if (!pixbuf) + { + GtkIconTheme* theme = gtk_icon_theme_get_default(); + pixbuf = gtk_icon_theme_load_icon(theme, IMAGE_MISSING.c_str(), size, GTK_ICON_LOOKUP_FORCE_SIZE, nullptr); + } + return pixbuf; } diff --git a/plugins/unityshell/CMakeLists.txt b/plugins/unityshell/CMakeLists.txt index 2de4ffeba..01a300589 100644 --- a/plugins/unityshell/CMakeLists.txt +++ b/plugins/unityshell/CMakeLists.txt @@ -21,35 +21,27 @@ if(revert_compiz) set (CMAKE_BUILD_TYPE "" CACHE STRING "Build type (Debug/Release/RelWithDebInfo/MinSizeRe)" FORCE) endif() -add_dependencies(unityshell - dash-lib - decorations-lib - hud-lib - launcher-lib - lockscreen-lib - panel-lib - shortcuts-lib - shutdown-lib - switcher-lib - unity-core-${UNITY_API_VERSION} - unity-shared - unity-shared-compiz) +set(UNITY_PRIVATE_LIBS + a11y-lib + dash-lib + decorations-lib + hud-lib + launcher-lib + lockscreen-lib + panel-lib + shortcuts-lib + shutdown-lib + switcher-lib + unity-core-${UNITY_API_VERSION} + unity-shared + unity-shared-bamf + unity-shared-compiz) + +add_dependencies(unityshell ${UNITY_PRIVATE_LIBS}) target_link_libraries(unityshell - dash-lib - decorations-lib - hud-lib - launcher-lib - pam - lockscreen-lib - panel-lib - shortcuts-lib - shutdown-lib - switcher-lib - unity-core-${UNITY_API_VERSION} - unity-shared - unity-shared-bamf - unity-shared-compiz) + ${UNITY_PRIVATE_LIBS} + pam) set_target_properties(unityshell PROPERTIES INSTALL_RPATH "${CACHED_UNITY_PRIVATE_DEPS_LIBRARY_DIRS}" diff --git a/plugins/unityshell/src/Monitor.cpp b/plugins/unityshell/src/Monitor.cpp deleted file mode 100644 index 7ecd8d72f..000000000 --- a/plugins/unityshell/src/Monitor.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- -/* -* Copyright (C) 2011 Canonical Ltd -* -* 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 by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* Authored by: Alex Launi <alex.launi@canonical.com> -*/ - -#include "Monitor.h" - -namespace unity { -namespace performance { - -void Monitor::Start () -{ - StartMonitor (); -} - -GVariant* Monitor::Stop () -{ - GVariantBuilder builder; - - g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); - StopMonitor (&builder); - - return g_variant_new ("a{sv}", &builder); -} - -} -} diff --git a/plugins/unityshell/src/Monitor.h b/plugins/unityshell/src/Monitor.h deleted file mode 100644 index 11a28c456..000000000 --- a/plugins/unityshell/src/Monitor.h +++ /dev/null @@ -1,46 +0,0 @@ -// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- -/* -* Copyright (C) 2011 Canonical Ltd -* -* 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 by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* Authored by: Alex Launi <alex.launi@canonical.com> -*/ - -#ifndef UNITY_PERFORMANCE_MONITOR -#define UNITY_PERFORMANCE_MONITOR - -#include <string> -#include <glib.h> - -namespace unity { -namespace performance { - -class Monitor -{ -public: - virtual ~Monitor() {} - - void Start(); - GVariant* Stop(); - virtual std::string GetName() const = 0; - -protected: - virtual void StartMonitor () = 0; - virtual void StopMonitor (GVariantBuilder* builder) = 0; -}; - -} -} - -#endif // UNITY_PERFORMANCE_MONITOR diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index fdc58f097..514eb2c83 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -71,8 +71,7 @@ #include <core/atoms.h> -#include "unitya11y.h" - +#include "a11y/unitya11y.h" #include "UBusMessages.h" #include "UBusWrapper.h" #include "UScreen.h" @@ -81,7 +80,7 @@ /* FIXME: once we get a better method to add the toplevel windows to the accessible root object, this include would not be required */ -#include "unity-util-accessible.h" +#include "a11y/unity-util-accessible.h" /* Set up vtable symbols */ COMPIZ_PLUGIN_20090315(unityshell, unity::UnityPluginVTable); diff --git a/resources/album_missing.png b/resources/album_missing.png Binary files differindex dbb56373b..631c9b45b 100644 --- a/resources/album_missing.png +++ b/resources/album_missing.png diff --git a/resources/album_missing_preview.png b/resources/album_missing_preview.png Binary files differindex 5d4716569..ca550def6 100644 --- a/resources/album_missing_preview.png +++ b/resources/album_missing_preview.png diff --git a/resources/category_gradient.png b/resources/category_gradient.png Binary files differindex 20fcc77a7..b1f40445b 100644 --- a/resources/category_gradient.png +++ b/resources/category_gradient.png diff --git a/resources/category_gradient_no_refine.png b/resources/category_gradient_no_refine.png Binary files differindex f391719fa..5943896d8 100644 --- a/resources/category_gradient_no_refine.png +++ b/resources/category_gradient_no_refine.png diff --git a/resources/dash_bottom_border_tile.png b/resources/dash_bottom_border_tile.png Binary files differindex 2a4328fb9..7fdc1593f 100644 --- a/resources/dash_bottom_border_tile.png +++ b/resources/dash_bottom_border_tile.png diff --git a/resources/dash_bottom_border_tile_mask.png b/resources/dash_bottom_border_tile_mask.png Binary files differindex 570d07027..7da0f403f 100644 --- a/resources/dash_bottom_border_tile_mask.png +++ b/resources/dash_bottom_border_tile_mask.png diff --git a/resources/dash_bottom_left_corner.png b/resources/dash_bottom_left_corner.png Binary files differindex 2aa62bcf9..dd3180155 100644 --- a/resources/dash_bottom_left_corner.png +++ b/resources/dash_bottom_left_corner.png diff --git a/resources/dash_bottom_left_corner_mask.png b/resources/dash_bottom_left_corner_mask.png Binary files differindex add1e4b5b..ed8b233a4 100644 --- a/resources/dash_bottom_left_corner_mask.png +++ b/resources/dash_bottom_left_corner_mask.png diff --git a/resources/dash_bottom_right_corner.png b/resources/dash_bottom_right_corner.png Binary files differindex 5ed3a1f59..1923a6aa9 100644 --- a/resources/dash_bottom_right_corner.png +++ b/resources/dash_bottom_right_corner.png diff --git a/resources/dash_bottom_right_corner_mask.png b/resources/dash_bottom_right_corner_mask.png Binary files differindex 7a7b20180..d8068c5e7 100644 --- a/resources/dash_bottom_right_corner_mask.png +++ b/resources/dash_bottom_right_corner_mask.png diff --git a/resources/dash_group_expand.png b/resources/dash_group_expand.png Binary files differindex 40f4c9936..5ae3b816c 100644 --- a/resources/dash_group_expand.png +++ b/resources/dash_group_expand.png diff --git a/resources/dash_group_unexpand.png b/resources/dash_group_unexpand.png Binary files differindex b12e15e1b..7ee3685e2 100644 --- a/resources/dash_group_unexpand.png +++ b/resources/dash_group_unexpand.png diff --git a/resources/dash_left_tile.png b/resources/dash_left_tile.png Binary files differindex ec22136fc..395784cee 100644 --- a/resources/dash_left_tile.png +++ b/resources/dash_left_tile.png diff --git a/resources/dash_noise.png b/resources/dash_noise.png Binary files differindex cc6461acd..1ae11be41 100644 --- a/resources/dash_noise.png +++ b/resources/dash_noise.png diff --git a/resources/dash_right_border_tile.png b/resources/dash_right_border_tile.png Binary files differindex 5a338b6e7..24ac7f921 100644 --- a/resources/dash_right_border_tile.png +++ b/resources/dash_right_border_tile.png diff --git a/resources/dash_right_border_tile_mask.png b/resources/dash_right_border_tile_mask.png Binary files differindex 3c8db6085..2f7434feb 100644 --- a/resources/dash_right_border_tile_mask.png +++ b/resources/dash_right_border_tile_mask.png diff --git a/resources/dash_sheen.png b/resources/dash_sheen.png Binary files differindex c66f9918f..fb31cdb6e 100644 --- a/resources/dash_sheen.png +++ b/resources/dash_sheen.png diff --git a/resources/dash_top_edge.png b/resources/dash_top_edge.png Binary files differindex 1d8ec9343..d024df6b4 100644 --- a/resources/dash_top_edge.png +++ b/resources/dash_top_edge.png diff --git a/resources/dash_top_right_corner.png b/resources/dash_top_right_corner.png Binary files differindex 154cd1621..4af9f5615 100644 --- a/resources/dash_top_right_corner.png +++ b/resources/dash_top_right_corner.png diff --git a/resources/dash_top_right_corner_mask.png b/resources/dash_top_right_corner_mask.png Binary files differindex 687efff76..be81ecd02 100644 --- a/resources/dash_top_right_corner_mask.png +++ b/resources/dash_top_right_corner_mask.png diff --git a/resources/dash_top_tile.png b/resources/dash_top_tile.png Binary files differindex e993c4e30..854e3006f 100644 --- a/resources/dash_top_tile.png +++ b/resources/dash_top_tile.png diff --git a/resources/dialog_close.png b/resources/dialog_close.png Binary files differindex 8b3301979..dd1aeb978 100644 --- a/resources/dialog_close.png +++ b/resources/dialog_close.png diff --git a/resources/dialog_close_highlight.png b/resources/dialog_close_highlight.png Binary files differindex 023d51fb4..c89f8d7f9 100644 --- a/resources/dialog_close_highlight.png +++ b/resources/dialog_close_highlight.png diff --git a/resources/dialog_close_press.png b/resources/dialog_close_press.png Binary files differindex 848406f09..8e17e5eb5 100644 --- a/resources/dialog_close_press.png +++ b/resources/dialog_close_press.png diff --git a/resources/hibernate.png b/resources/hibernate.png Binary files differindex e91086ee1..36155d40c 100644 --- a/resources/hibernate.png +++ b/resources/hibernate.png diff --git a/resources/hibernate_highlight.png b/resources/hibernate_highlight.png Binary files differindex 642bd8655..a0059818d 100644 --- a/resources/hibernate_highlight.png +++ b/resources/hibernate_highlight.png diff --git a/resources/launcher_bfb.png b/resources/launcher_bfb.png Binary files differindex 28768e3f2..9ffc9ec63 100644 --- a/resources/launcher_bfb.png +++ b/resources/launcher_bfb.png diff --git a/resources/launcher_icon_glow_62.png b/resources/launcher_icon_glow_62.png Binary files differindex 9e21628f5..1b3387c6a 100644 --- a/resources/launcher_icon_glow_62.png +++ b/resources/launcher_icon_glow_62.png diff --git a/resources/launcher_pressure_effect.png b/resources/launcher_pressure_effect.png Binary files differindex 7523d07d8..711151711 100644 --- a/resources/launcher_pressure_effect.png +++ b/resources/launcher_pressure_effect.png diff --git a/resources/lock_icon.png b/resources/lock_icon.png Binary files differindex 80372f7c8..d9c45d02b 100644 --- a/resources/lock_icon.png +++ b/resources/lock_icon.png diff --git a/resources/lockscreen.png b/resources/lockscreen.png Binary files differindex 633e2bdb1..0e0cca6c9 100644 --- a/resources/lockscreen.png +++ b/resources/lockscreen.png diff --git a/resources/lockscreen_highlight.png b/resources/lockscreen_highlight.png Binary files differindex 992f21008..4cb885003 100644 --- a/resources/lockscreen_highlight.png +++ b/resources/lockscreen_highlight.png diff --git a/resources/logout.png b/resources/logout.png Binary files differindex 73b1e4840..59ffbbf17 100644 --- a/resources/logout.png +++ b/resources/logout.png diff --git a/resources/logout_highlight.png b/resources/logout_highlight.png Binary files differindex ee4f4ddc5..9ab994fb2 100644 --- a/resources/logout_highlight.png +++ b/resources/logout_highlight.png diff --git a/resources/panel-shadow.png b/resources/panel-shadow.png Binary files differindex 8b453716f..a37c8fe87 100644 --- a/resources/panel-shadow.png +++ b/resources/panel-shadow.png diff --git a/resources/pattern_overlay.png b/resources/pattern_overlay.png Binary files differindex a3cb82aa1..ee856c771 100644 --- a/resources/pattern_overlay.png +++ b/resources/pattern_overlay.png diff --git a/resources/places-tile-bg-tilable.png b/resources/places-tile-bg-tilable.png Binary files differindex c0fde8dce..f024fa624 100644 --- a/resources/places-tile-bg-tilable.png +++ b/resources/places-tile-bg-tilable.png diff --git a/resources/refine_gradient_corner.png b/resources/refine_gradient_corner.png Binary files differindex d485f4498..288862745 100644 --- a/resources/refine_gradient_corner.png +++ b/resources/refine_gradient_corner.png diff --git a/resources/refine_gradient_dash.png b/resources/refine_gradient_dash.png Binary files differindex e1faf2165..17214cc5f 100644 --- a/resources/refine_gradient_dash.png +++ b/resources/refine_gradient_dash.png diff --git a/resources/refine_gradient_panel.png b/resources/refine_gradient_panel.png Binary files differindex d283f0977..fa23f1228 100644 --- a/resources/refine_gradient_panel.png +++ b/resources/refine_gradient_panel.png diff --git a/resources/refine_gradient_panel_single_column.png b/resources/refine_gradient_panel_single_column.png Binary files differindex 7ce0efa2f..38b9b4956 100644 --- a/resources/refine_gradient_panel_single_column.png +++ b/resources/refine_gradient_panel_single_column.png diff --git a/resources/restart.png b/resources/restart.png Binary files differindex 18363f3b9..6f6b3ba81 100644 --- a/resources/restart.png +++ b/resources/restart.png diff --git a/resources/restart_highlight.png b/resources/restart_highlight.png Binary files differindex c8dda0874..8d01098ce 100644 --- a/resources/restart_highlight.png +++ b/resources/restart_highlight.png diff --git a/resources/round_corner_54x54.png b/resources/round_corner_54x54.png Binary files differindex f9c152506..16a3bcaf1 100644 --- a/resources/round_corner_54x54.png +++ b/resources/round_corner_54x54.png diff --git a/resources/round_glow_62x62.png b/resources/round_glow_62x62.png Binary files differindex 08481dde0..dcfdb3e72 100644 --- a/resources/round_glow_62x62.png +++ b/resources/round_glow_62x62.png diff --git a/resources/round_glow_hl_62x62.png b/resources/round_glow_hl_62x62.png Binary files differindex 99f40fa63..26690984e 100644 --- a/resources/round_glow_hl_62x62.png +++ b/resources/round_glow_hl_62x62.png diff --git a/resources/round_shine_54x54.png b/resources/round_shine_54x54.png Binary files differindex cfb1cd86e..26128a584 100644 --- a/resources/round_shine_54x54.png +++ b/resources/round_shine_54x54.png diff --git a/resources/search_close.png b/resources/search_close.png Binary files differindex 383e44e4e..17e56e651 100644 --- a/resources/search_close.png +++ b/resources/search_close.png diff --git a/resources/search_spin.png b/resources/search_spin.png Binary files differindex 56ebb9c39..a41ec31c2 100644 --- a/resources/search_spin.png +++ b/resources/search_spin.png diff --git a/resources/shutdown.png b/resources/shutdown.png Binary files differindex 99b4cb788..62ffcd889 100644 --- a/resources/shutdown.png +++ b/resources/shutdown.png diff --git a/resources/shutdown_highlight.png b/resources/shutdown_highlight.png Binary files differindex c1e966438..9386fd233 100644 --- a/resources/shutdown_highlight.png +++ b/resources/shutdown_highlight.png diff --git a/resources/squircle_base_selected_54.png b/resources/squircle_base_selected_54.png Binary files differindex 405c218a4..bbf133fa8 100644 --- a/resources/squircle_base_selected_54.png +++ b/resources/squircle_base_selected_54.png diff --git a/resources/squircle_edge_54.png b/resources/squircle_edge_54.png Binary files differindex f0e54a544..45cf53fa6 100644 --- a/resources/squircle_edge_54.png +++ b/resources/squircle_edge_54.png diff --git a/resources/squircle_shine_54.png b/resources/squircle_shine_54.png Binary files differindex 2b2f1a574..1c8f35798 100644 --- a/resources/squircle_shine_54.png +++ b/resources/squircle_shine_54.png diff --git a/resources/star_deselected.png b/resources/star_deselected.png Binary files differindex fb3ca3674..5404d5da9 100644 --- a/resources/star_deselected.png +++ b/resources/star_deselected.png diff --git a/resources/suspend.png b/resources/suspend.png Binary files differindex 4e12179fc..458d8845d 100644 --- a/resources/suspend.png +++ b/resources/suspend.png diff --git a/resources/suspend_highlight.png b/resources/suspend_highlight.png Binary files differindex a06106eea..8af6cc81f 100644 --- a/resources/suspend_highlight.png +++ b/resources/suspend_highlight.png diff --git a/resources/switcher_background.png b/resources/switcher_background.png Binary files differindex 1e3c07537..f05f88b6c 100644 --- a/resources/switcher_background.png +++ b/resources/switcher_background.png diff --git a/resources/switcher_corner.png b/resources/switcher_corner.png Binary files differindex dca840a5f..4bae2412f 100644 --- a/resources/switcher_corner.png +++ b/resources/switcher_corner.png diff --git a/resources/switcher_left.png b/resources/switcher_left.png Binary files differindex 658aea80d..b852b10f1 100644 --- a/resources/switcher_left.png +++ b/resources/switcher_left.png diff --git a/resources/switcher_top.png b/resources/switcher_top.png Binary files differindex 417d98839..595d842dd 100644 --- a/resources/switcher_top.png +++ b/resources/switcher_top.png diff --git a/resources/video_missing.png b/resources/video_missing.png Binary files differindex 0de4797e9..859dea7d3 100644 --- a/resources/video_missing.png +++ b/resources/video_missing.png diff --git a/resources/warning_icon.png b/resources/warning_icon.png Binary files differindex 0c5deb7e8..5ab2843f2 100644 --- a/resources/warning_icon.png +++ b/resources/warning_icon.png diff --git a/shortcuts/AbstractShortcutHint.h b/shortcuts/AbstractShortcutHint.h index d17852847..8eb8487fa 100644 --- a/shortcuts/AbstractShortcutHint.h +++ b/shortcuts/AbstractShortcutHint.h @@ -36,7 +36,8 @@ enum class OptionType : unsigned COMPIZ_KEY = 0, COMPIZ_METAKEY, COMPIZ_MOUSE, - HARDCODED + HARDCODED, + GNOME /* GSETTINGS, * GCONF */ }; diff --git a/shortcuts/CompizShortcutModeller.cpp b/shortcuts/CompizShortcutModeller.cpp index 5f9543407..de2f30d02 100644 --- a/shortcuts/CompizShortcutModeller.cpp +++ b/shortcuts/CompizShortcutModeller.cpp @@ -244,6 +244,16 @@ void CompizModeller::AddMenuHints(std::list<shortcut::AbstractHint::Ptr> &hints) _("Moves focus between indicators."), shortcut::OptionType::HARDCODED, _("Cursor Left or Right"))); + + hints.push_back(std::make_shared<shortcut::Hint>(menubar, "", "", + _("Take a screenshot."), + shortcut::OptionType::GNOME, + "screenshot")); + + hints.push_back(std::make_shared<shortcut::Hint>(menubar, "", "", + _("Take a screenshot of the current window."), + shortcut::OptionType::GNOME, + "window-screenshot")); } void CompizModeller::AddSwitcherHints(std::list<shortcut::AbstractHint::Ptr> &hints, bool ws_enabled) diff --git a/shortcuts/MockShortcutHint.h b/shortcuts/MockShortcutHint.h index f1317d416..13f964552 100644 --- a/shortcuts/MockShortcutHint.h +++ b/shortcuts/MockShortcutHint.h @@ -59,6 +59,9 @@ public: value = arg1(); shortkey = prefix() + value() + postfix(); return true; + case OptionType::GNOME: + value = arg1(); + return true; } return false; diff --git a/shortcuts/ShortcutHint.cpp b/shortcuts/ShortcutHint.cpp index 8f0d4b225..898374543 100644 --- a/shortcuts/ShortcutHint.cpp +++ b/shortcuts/ShortcutHint.cpp @@ -21,16 +21,19 @@ #include <core/core.h> // Compiz... #include <NuxCore/Logger.h> +#include <UnityCore/GLibWrapper.h> #include "ShortcutHintPrivate.h" -DECLARE_LOGGER(logger, "unity.shortcut"); - namespace unity { namespace shortcut { - +namespace +{ + const std::string GNOME_MEDIA_SETTINGS = "org.gnome.settings-daemon.plugins.media-keys"; + DECLARE_LOGGER(logger, "unity.shortcut"); +} // Ctor Hint::Hint(std::string const& category, std::string const& prefix, @@ -152,6 +155,22 @@ bool Hint::Fill() shortkey = prefix() + value() + postfix(); } return true; + case OptionType::GNOME: + { + glib::Object<GSettings> key_settings(g_settings_new(GNOME_MEDIA_SETTINGS.c_str())); + glib::String key(g_settings_get_string(key_settings, arg1().c_str())); + + std::string temp(impl::GetTranslatableLabel(key.Str())); + temp = impl::ProperCase(temp); + + if (value() != temp) + { + value = temp; + shortkey = value(); + } + + return true; + } default: LOG_WARNING(logger) << "Unable to find the option type" << static_cast<unsigned>(type()); diff --git a/tests/test_layout_system.cpp b/tests/test_layout_system.cpp index 3fd9d1cb9..bd1f23c98 100644 --- a/tests/test_layout_system.cpp +++ b/tests/test_layout_system.cpp @@ -81,11 +81,71 @@ TEST_F(TestLayoutWindow, InitializationMaximizedWindow) auto fake_window = AddFakeWindowToWM(xid); wm->Maximize(xid); + LayoutWindow lwin(xid); + EXPECT_EQ(lwin.xid, xid); + EXPECT_EQ(lwin.geo, fake_window->geo); + EXPECT_EQ(lwin.decoration_height, 0); + EXPECT_EQ(lwin.selected, false); + EXPECT_EQ(lwin.aspect_ratio, fake_window->geo().width / static_cast<float>(fake_window->geo().height)); +} + +TEST_F(TestLayoutWindow, InitializationMinimizedMaximizedWindow) +{ + const Window xid = g_random_int(); + auto fake_window = AddFakeWindowToWM(xid); + wm->Maximize(xid); + wm->Minimize(xid); + + LayoutWindow lwin(xid); + EXPECT_EQ(lwin.xid, xid); + EXPECT_EQ(lwin.geo, fake_window->geo); + EXPECT_EQ(lwin.decoration_height, 0); + EXPECT_EQ(lwin.selected, false); + EXPECT_EQ(lwin.aspect_ratio, fake_window->geo().width / static_cast<float>(fake_window->geo().height)); +} + +TEST_F(TestLayoutWindow, DecorationHeightNormalWindow) +{ + const Window xid = g_random_int(); + auto fake_window = AddFakeWindowToWM(xid); + + LayoutWindow lwin(xid); + lwin.ComputeDecorationHeight(); + EXPECT_EQ(lwin.xid, xid); + EXPECT_EQ(lwin.geo, fake_window->geo); + EXPECT_EQ(lwin.decoration_height, 0); + EXPECT_EQ(lwin.selected, false); + EXPECT_FLOAT_EQ(lwin.scale, 1.0f); + EXPECT_EQ(lwin.aspect_ratio, fake_window->geo().width / static_cast<float>(fake_window->geo().height)); +} + +TEST_F(TestLayoutWindow, DecorationHeightMinimizedNormalWindow) +{ + const Window xid = g_random_int(); + auto fake_window = AddFakeWindowToWM(xid); + wm->Minimize(xid); + + LayoutWindow lwin(xid); + lwin.ComputeDecorationHeight(); + EXPECT_EQ(lwin.xid, xid); + EXPECT_EQ(lwin.geo, fake_window->geo); + EXPECT_EQ(lwin.decoration_height, 0); + EXPECT_EQ(lwin.selected, false); + EXPECT_EQ(lwin.aspect_ratio, fake_window->geo().width / static_cast<float>(fake_window->geo().height)); +} + +TEST_F(TestLayoutWindow, DecorationHeightMaximizedWindow) +{ + const Window xid = g_random_int(); + auto fake_window = AddFakeWindowToWM(xid); + wm->Maximize(xid); + nux::Geometry expected_geo(fake_window->geo); unsigned top_deco = wm->GetWindowDecorationSize(xid, WindowManager::Edge::TOP).height; expected_geo.height += top_deco; LayoutWindow lwin(xid); + lwin.ComputeDecorationHeight(); EXPECT_EQ(lwin.xid, xid); EXPECT_EQ(lwin.geo, expected_geo); EXPECT_EQ(lwin.decoration_height, top_deco); @@ -93,7 +153,7 @@ TEST_F(TestLayoutWindow, InitializationMaximizedWindow) EXPECT_EQ(lwin.aspect_ratio, expected_geo.width / static_cast<float>(expected_geo.height)); } -TEST_F(TestLayoutWindow, InitializationMinimizedMaximizedWindow) +TEST_F(TestLayoutWindow, DecorationHeightMinimizedMaximizedWindow) { const Window xid = g_random_int(); auto fake_window = AddFakeWindowToWM(xid); diff --git a/tests/test_switcher_model.cpp b/tests/test_switcher_model.cpp index c02e9dcee..558514140 100644 --- a/tests/test_switcher_model.cpp +++ b/tests/test_switcher_model.cpp @@ -79,7 +79,10 @@ TEST_F(TestSwitcherModel, TestConstructor) EXPECT_EQ(model->LastSelection(), icons_.front()); EXPECT_EQ(model->SelectionIndex(), 0); EXPECT_EQ(model->LastSelectionIndex(), 0); - EXPECT_EQ(static_cast<unsigned int>(model->detail_selection_index), 0); + EXPECT_FALSE(model->SelectionWindows().empty()); + EXPECT_TRUE(model->DetailXids().empty()); + EXPECT_FALSE(model->detail_selection); + EXPECT_EQ(model->detail_selection_index, 0u); } @@ -154,10 +157,22 @@ TEST_F(TestSwitcherModel, SelectionIsActive) EXPECT_TRUE(model->SelectionIsActive()); } +TEST_F(TestSwitcherModel, DetailXidsIsValidOnSelectionOnly) +{ + model->detail_selection = true; + EXPECT_FALSE(model->DetailXids().empty()); + EXPECT_EQ(model->DetailXids(), model->SelectionWindows()); + + model->detail_selection = false; + EXPECT_TRUE(model->DetailXids().empty()); + EXPECT_FALSE(model->SelectionWindows().empty()); +} + TEST_F(TestSwitcherModel, TestWebAppActive) { // Create a base case auto base_model = std::make_shared<SwitcherModel>(icons_, false); + base_model->detail_selection = true; // Set the first icon as Active to simulate Firefox being active icons_.front()->SetQuirk(AbstractLauncherIcon::Quirk::ACTIVE, true); @@ -166,7 +181,7 @@ TEST_F(TestSwitcherModel, TestWebAppActive) icons_.back()->SetQuirk(AbstractLauncherIcon::Quirk::ACTIVE, true); auto new_model = std::make_shared<SwitcherModel>(icons_, false); - new_model->DetailXids(); + new_model->detail_selection = true; // model's front Window should be different than the base case due to the // re-sorting in DetailXids(). diff --git a/tools/unity.cmake b/tools/unity.cmake index 9e71a6a32..787c920ca 100755 --- a/tools/unity.cmake +++ b/tools/unity.cmake @@ -107,9 +107,9 @@ def process_and_start_unity (verbose, debug_mode, compiz_path, compiz_args, log_ try: pid_path = os.path.join("/proc", pid) cmdline = open(os.path.join(pid_path, "cmdline"), "rb").read() - if re.match(r"^compiz\b", cmdline): + if re.match(rb"^compiz\b", cmdline): compiz_env = open(os.path.join(pid_path, "environ"), "rb").read() - if display in compiz_env: + if display in compiz_env.decode(sys.getdefaultencoding()): subprocess.call (["kill", "-9", pid]) except IOError: continue diff --git a/unity-shared/GnomeKeyGrabber.cpp b/unity-shared/GnomeKeyGrabber.cpp index 603daa2af..300b07ebe 100644 --- a/unity-shared/GnomeKeyGrabber.cpp +++ b/unity-shared/GnomeKeyGrabber.cpp @@ -98,7 +98,9 @@ bool GnomeGrabber::Impl::AddAction(CompAction const& action, uint32_t& action_id auto it = std::find(actions_.begin(), actions_.end(), action); if (it != actions_.end()) { - action_id = actions_ids_[it - actions_.begin()]; + auto action_index = it - actions_.begin(); + action_id = actions_ids_[action_index]; + ++actions_customers_[action_index]; LOG_DEBUG(logger) << "Key binding \"" << action.keyToString() << "\" is already grabbed, reusing id " << action_id; return true; } @@ -107,6 +109,7 @@ bool GnomeGrabber::Impl::AddAction(CompAction const& action, uint32_t& action_id { actions_ids_.push_back(action_id); actions_.push_back(action); + actions_customers_.push_back(1); return true; } @@ -148,12 +151,23 @@ bool GnomeGrabber::Impl::RemoveActionByIndex(size_t index) if (!index || index >= actions_.size()) return false; + if (actions_customers_[index] > 1) + { + LOG_DEBUG(logger) << "Not removing action " << actions_[index].keyToString() + << " as it is used by multiple customers (" + << actions_customers_[index] << ")"; + + --actions_customers_[index]; + return false; + } + CompAction* action = &(actions_[index]); LOG_DEBUG(logger) << "RemoveAction (\"" << action->keyToString() << "\")"; screen_->removeAction(action); actions_.erase(actions_.begin() + index); actions_ids_.erase(actions_ids_.begin() + index); + actions_customers_.erase(actions_customers_.begin() + index); return true; } @@ -258,7 +272,7 @@ uint32_t GnomeGrabber::Impl::GrabDBusAccelerator(std::string const& owner, std:: if (it != actions_by_owner_.end()) { for (auto action_id : it->second.actions) - RemoveActionForOwner(action_id, name); + RemoveActionByID(action_id); actions_by_owner_.erase(it); } @@ -284,7 +298,7 @@ bool GnomeGrabber::Impl::UnGrabDBusAccelerator(std::string const& owner, uint32_ if (actions.empty()) actions_by_owner_.erase(it); - return RemoveActionForOwner(action_id, owner); + return RemoveActionByID(action_id); } LOG_WARN(logger) << "Action " << action_id << " was not registered by " << owner << ". " @@ -292,24 +306,6 @@ bool GnomeGrabber::Impl::UnGrabDBusAccelerator(std::string const& owner, uint32_ return false; } -bool GnomeGrabber::Impl::RemoveActionForOwner(uint32_t action_id, std::string const& owner) -{ - for (auto it = actions_by_owner_.begin(); it != actions_by_owner_.end(); ++it) - { - if (it->first == owner) - continue; - - auto const& actions = it->second.actions; - if (actions.find(action_id) != actions.end()) - { - LOG_DEBUG(logger) << "Action " << action_id << " registered for multiple destinations, not removed"; - return false; - } - } - - return RemoveActionByID(action_id); -} - void GnomeGrabber::Impl::ActivateDBusAction(CompAction const& action, uint32_t action_id, uint32_t device, uint32_t timestamp) const { LOG_DEBUG(logger) << "ActivateAction (" << action_id << " \"" << action.keyToString() << "\")"; diff --git a/unity-shared/GnomeKeyGrabberImpl.h b/unity-shared/GnomeKeyGrabberImpl.h index 2c03827dd..50926e9a8 100644 --- a/unity-shared/GnomeKeyGrabberImpl.h +++ b/unity-shared/GnomeKeyGrabberImpl.h @@ -52,7 +52,6 @@ struct GnomeGrabber::Impl uint32_t GrabDBusAccelerator(std::string const& owner, std::string const& accelerator, uint32_t flags); bool UnGrabDBusAccelerator(std::string const& sender, uint32_t action_id); void ActivateDBusAction(CompAction const& action, uint32_t id, uint32_t device, uint32_t timestamp) const; - bool RemoveActionForOwner(uint32_t action_id, std::string const& owner); bool IsActionPostponed(CompAction const& action) const; @@ -63,6 +62,7 @@ struct GnomeGrabber::Impl uint32_t current_action_id_; std::vector<uint32_t> actions_ids_; + std::vector<uint32_t> actions_customers_; CompAction::Vector actions_; struct OwnerActions { glib::DBusNameWatcher::Ptr watcher; std::unordered_set<uint32_t> actions; }; diff --git a/unity-shared/LayoutSystem.cpp b/unity-shared/LayoutSystem.cpp index 396ee4cac..cac1e0449 100644 --- a/unity-shared/LayoutSystem.cpp +++ b/unity-shared/LayoutSystem.cpp @@ -301,6 +301,9 @@ LayoutWindow::LayoutWindow(Window xid) , aspect_ratio(geo.width / static_cast<float>(geo.height)) , scale(1.0f) , alpha(0.0f) +{} + +void LayoutWindow::ComputeDecorationHeight() { auto& wm = WindowManager::Default(); diff --git a/unity-shared/LayoutSystem.h b/unity-shared/LayoutSystem.h index 96b7d9c90..1dfdd8766 100644 --- a/unity-shared/LayoutSystem.h +++ b/unity-shared/LayoutSystem.h @@ -38,6 +38,8 @@ public: LayoutWindow(Window xid); + void ComputeDecorationHeight(); + Window xid; nux::Geometry geo; diff --git a/unity-shared/TextInput.cpp b/unity-shared/TextInput.cpp index 360c8e571..ee111864b 100644 --- a/unity-shared/TextInput.cpp +++ b/unity-shared/TextInput.cpp @@ -232,6 +232,7 @@ void TextInput::OnLockStateChanged(bool) } warning_->SetVisible(caps_lock_on() || num_lock_on()); + warning_->SetOpacity((num_lock_on() && !caps_lock_on()) ? 0.3 : 1.0); warning_tooltip_.Release(); QueueRelayout(); QueueDraw(); |
