Commit Graph

62 Commits

Author SHA1 Message Date
Giovanni Campagna
aef70152de Keyboard: clear currentSource after destruction
StLabel doesn't like that we set its properties after destructions,
and this would happen in currentInputSourceChanged() at the end,
when setting the ornament.
2013-04-24 21:47:03 +02:00
Jasper St. Pierre
4a2f54f6ff popupMenu: Define the dot next to the menu as an "ornament"
We want to remove switches in remote menus, so make way for
a checkmark ornament for the popup menu item.

https://bugzilla.gnome.org/show_bug.cgi?id=698427
2013-04-23 15:35:55 -04:00
Rui Matos
01deb9ef7d status/keyboard: Check if this._currentSource is valid on activation
this._currentSource might be invalid so check for that to prevent an
exception and still switch to the newly activated source.

https://bugzilla.gnome.org/show_bug.cgi?id=695841
2013-03-14 14:56:28 +01:00
Rui Matos
5c89568cca status/keyboard: Always hide the old source panel indicator label
When we switch into an invalid input source we hide the panel
indicator and return early but we were not hiding the previously
active source label and its menu item dot and thus when switching
again to a third input source we would end up showing 2 overlapping
labels in the panel and the menu would have 2 entries with a dot.

https://bugzilla.gnome.org/show_bug.cgi?id=695841
2013-03-14 14:56:27 +01:00
Takao Fujiwara
04e4d69662 IBus.Property's state needs to be kept in IBus.PropType.NORMAL
https://bugzilla.gnome.org/show_bug.cgi?id=695824
2013-03-14 09:41:58 +01:00
Rui Matos
e5ca53e56c status/keyboard: Don't allow the switcher in the message tray
SwitcherPopup relies on being able to pushModal(), setting the stage
input mode to FULLSCREEN, and then doing regular event processing on
the actor it adds to uiGroup. But MessageTray uses GrabHelper which
sets up a 'captured-event' handler on the stage and thus gets all
events itself.

This, of course, breaks the switcher if it's brought up in the message
tray so, for now, we'll just prevent it from being used there.

https://bugzilla.gnome.org/show_bug.cgi?id=693907
2013-03-04 18:32:49 +01:00
Rui Matos
7e1b4692e2 status/keyboard: Don't show the switcher with less than 2 items
https://bugzilla.gnome.org/show_bug.cgi?id=695000
2013-03-04 00:30:04 +01:00
Jasper St. Pierre
c0e5719271 keyboard: Don't use set_skip_paint
https://bugzilla.gnome.org/show_bug.cgi?id=693303
2013-02-07 05:43:50 -05:00
Jasper St. Pierre
997f851031 keyboard: Make sure to set currentSource if we only have one source
This way, popping up and re-closing the switcher won't emit an error
trying to check for this._currentSource.

https://bugzilla.gnome.org/show_bug.cgi?id=693303
2013-02-07 05:43:50 -05:00
Jeremy Bicha
f0203d1f19 general: Use & instead of 'and' for Settings panels
UI consistency follow up from bug 676562

https://bugzilla.gnome.org/show_bug.cgi?id=689590
2013-02-05 08:54:16 -05:00
Florian Müllner
b682c8e052 main: Move KeybindingMode into Shell
Having the definition in C instead of Javascript allows sharing
the corresponding header with gnome-settings-daemon.

https://bugzilla.gnome.org/show_bug.cgi?id=643111
2013-02-04 16:48:40 +01:00
Florian Müllner
65bf0d20e7 keyboard: Fix a warning
While we handle the case where ibus_bus_get_global_engine() returns
NULL, this case actually generates an exception we have to catch to
avoid some (harmless) console spam.

https://bugzilla.gnome.org/show_bug.cgi?id=692995
2013-02-01 13:06:00 +01:00
Rui Matos
16bb9c17f5 status/keyboard: Add input source switching per window
If the setting is enabled, we record the last activated input source
for the currently focused window and switch to it when focusing back
that window. The Overview is considered a window for this purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=691414
2013-01-14 11:11:00 +01:00
Rui Matos
ca44977d92 status/keyboard: Only change the current source setting if it changed
This avoids all the work that goes on in various processes when
switching input sources if the activated source is the currently
configured one.

https://bugzilla.gnome.org/show_bug.cgi?id=691414
2013-01-14 11:11:00 +01:00
Rui Matos
07511cb21a Handle 'switch-input-source' keybinding move
Moving this to gsettings-desktop-schemas instead so that
gnome-control-center doesn't have to grow a dependency on gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=690427
2012-12-18 16:13:13 +00:00
Rui Matos
f61548234a status/keyboard: Add an Alt+Tab like input source switcher
https://bugzilla.gnome.org/show_bug.cgi?id=682315
2012-12-17 11:43:02 +00:00
Rui Matos
6eef830ba4 status/keyboard: Keep a list of input sources in MRU order
This will allow us to provide an Alt+Tab like input source switcher.

https://bugzilla.gnome.org/show_bug.cgi?id=682315
2012-12-17 11:43:02 +00:00
Rui Matos
2008feb7da status/keyboard: Store IBus engine properties per InputSource object
Instead of storing them globally and having an hardcoded list of
engines which are allowed to change their indicator symbol when the
InputMode property changes.

https://bugzilla.gnome.org/show_bug.cgi?id=682318
2012-12-17 11:43:01 +00:00
Rui Matos
c41424b57b status/keyboard: Make input sources be proper objects
Introduce an InputSource class which makes it easier to keep track of
all the data we have about them.

https://bugzilla.gnome.org/show_bug.cgi?id=682318
2012-12-17 11:43:01 +00:00
Giovanni Campagna
5de91197ae status/keyboard: remove the property whitelist
It was just a stopgap solution for 3.6, as the necessary UI bits
were not implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=682318
2012-12-14 00:47:19 +01:00
Giovanni Campagna
bc6b4b01ea status/keyboard: implement remaining property types
Input methods other than Anthy need different property types, so we
should support all those exposed by the IBus protocol.

https://bugzilla.gnome.org/show_bug.cgi?id=682318
2012-12-14 00:47:19 +01:00
Matthias Clasen
24efeff788 Really hide 'Show Keyboard Layout' on the lock screen
We have to set _showLayoutItem.actor.visible,
not _showLayoutItem.visible.
2012-10-02 15:34:10 -04:00
Florian Müllner
d0a77b7e0c keyboard: Make input source items accessible
https://bugzilla.gnome.org/show_bug.cgi?id=684462
2012-09-20 19:59:27 +02:00
Rui Matos
5c7da4b0e6 status/keyboard: Fix hidden separator when menu changes while open
Due to the way the IBus API works we might get property changes while
the menu is already open. In that case the separator visibility logic
doesn't work since it only applies on menu open/close. This works
around that issue.

https://bugzilla.gnome.org/show_bug.cgi?id=682314
2012-09-18 21:32:37 +02:00
Rui Matos
9659d934ac status/keyboard: Add menu items for IBus Anthy's InputMode, TypingMode
IBus has a properties API which are basically generic knobs into the
engine which are serialized and presented in a way that allows us to
easily build actionable UI elements with them.

Instead of implementing the whole generic system and accepting
everything coming out of the engines, for now, this patch just adds
support for a couple of important IBus Anthy properties.

https://bugzilla.gnome.org/show_bug.cgi?id=682314
2012-09-18 21:32:37 +02:00
Rui Matos
409af28cb7 status/keyboard: Handle IBus engines which don't specify a symbol
In this case, fall back to the 2 or 3 letter language code or, failing
that, to a keyboard symbol.

https://bugzilla.gnome.org/show_bug.cgi?id=683613
2012-09-12 18:54:51 +02:00
Rui Matos
4fe604bfe8 status/keyboard: Make IBus display strings consistent with g-c-c
Instead of entries like "Anthy" we want "Japanese (Anthy)".

https://bugzilla.gnome.org/show_bug.cgi?id=683124
2012-09-12 18:54:50 +02:00
Jasper St. Pierre
ca2e09fe8b sessionMode: Allow changing the session mode at runtime
Since we eventually want to add a system for changing the top panel
contents depending on the current state of the shell, let's use the
"session mode" feature for this, and add a mechanism for updating the
session mode at runtime. Add support for every key besides the two
functional keys, and make all the components update automatically when the
session mode is changed. Add a new lock-screen mode, and make the lock
screen change to this when locked.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 18:42:44 -03:00
Alban Browaeys
9082b4df48 keyboard: _showLayoutItem is only defined if allowSettings.
Check Main.sessionMode.allowSettings is true before accessing the
actor item of _showLayoutItem.

https://bugzilla.gnome.org/show_bug.cgi?id=681101
2012-08-07 16:50:07 +02:00
Jasper St. Pierre
e875b9cdca status: Clean up imports
https://bugzilla.gnome.org/show_bug.cgi?id=680426
2012-08-03 14:25:35 -03:00
Giovanni Campagna
c3afe1a83a Show the panel above the screenshield when locked
Track locked status and use it to provide a reduced version of
the panel in the locked screen. Accessibility, input sources and
volume menus are preserved, without the link to the control center.
Network, battery and user menu are reduced to pure indicators,
with no menu.
This is similar to the design but not exactly, because designers
in IRC said that network needs more analysis before exposing, and
because the design didn't account for a11y and IM (so the one menu
metaphor is not really appropriate).

https://bugzilla.gnome.org/show_bug.cgi?id=619955
2012-07-21 15:40:28 +02:00
Rui Matos
04074f883f ibusCandidatePopup: A candidate popup for IBus input methods
This is an implementation of the org.freedesktop.IBus.Panel API which
shows a shell style popup (BoxPointer) when using an IBus input
method.

Based on code from the ibus-gjs project[1].

[1] https://github.com/fujiwarat/ibus-gjs

https://bugzilla.gnome.org/show_bug.cgi?id=641531
2012-07-16 00:59:13 +02:00
Rui Matos
14d3235f1a status/keyboard: Add support for IBus input sources
We connect to the IBus daemon asyncronously and use it to query info
about input sources of the type 'ibus'. In case the daemon is or
becomes unreachable we just skip showing input sources of this type.

https://bugzilla.gnome.org/show_bug.cgi?id=641531
2012-07-16 00:59:11 +02:00
Rui Matos
ec0730f3e5 status/keyboard: Port to the new input sources settings
https://bugzilla.gnome.org/show_bug.cgi?id=641531
2012-06-01 22:18:59 +02:00
Florian Müllner
a3fcb8c284 sessionMode: Add allowSettings property
Add a sessionMode.allowSettings property, which determines whether
menus in the top bar should allow access to System Settings or not.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
2012-05-22 19:42:28 +02:00
Florian Müllner
3d26224180 Delegate mode information to a dedicated object
Rather than accessing global.session_type / global.session_mode
all over the place, delegate mode information to a dedicated
sessionMode object. While not very useful for now, we will replace
checks for a particular mode with checks for particular properties
that sessionMode defines based on global.session_mode.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
2012-05-22 19:42:27 +02:00
Florian Müllner
a2d4f133b7 a11y: Set a name for the keyboard status icon
https://bugzilla.gnome.org/show_bug.cgi?id=672719
2012-04-13 13:31:44 +02:00
Giovanni Campagna
566bdb50c2 Port PanelMenu to new class framework
Second patch in the class framework, now it's the turn of
PanelMenu (buttons, menus and status indicators).

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Giovanni Campagna
2b57603271 Port PopupMenu to new Lang.Class framework
The Lang module in gjs has recently gained a small yet powerful
Class framework, that should help improve the readability of code
when using complex inheritance.
This commit starts porting shell code, by rewriting all classes in
popupMenu.js (and all derived classes) to Lang.Class.

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Dan Winship
75b824d032 *.js: Make emacs modelines consistent
js2-mode is no longer developed and we recommend js-mode these days,
so switch the modelines to specify that, and make them consistent
across all files.

https://bugzilla.gnome.org/show_bug.cgi?id=660358
2011-10-11 08:05:12 -04:00
Dan Winship
ae00f86887 panel: allow padding around panel buttons to shrink
for narrow screens (eg, portrait orientation)

https://bugzilla.gnome.org/show_bug.cgi?id=651299
2011-09-19 17:43:54 -04:00
Dan Winship
f23239a923 status/keyboard: use correct style class name to fix menu highlight
The keyboard status item doesn't derive from SystemStatusButton, since
it doesn't use an icon. But this meant it wasn't getting the right
class name, and so was using the full-width menu title highlight
rather than the small one. Fix that.
2011-09-19 17:36:13 -04:00
Dan Winship
d949920e68 status/keyboard: fix function naming style 2011-09-19 17:36:13 -04:00
Matthias Clasen
b5fa48f485 status: don't show 'Show Keyboard Layout' on the login screen
It does not make a great amount of sense to have this function
on the login screen. And worse, it does not work, since the greeter
is currently a modal dialog, so interaction with the opening
window is impossible.

https://bugzilla.gnome.org/show_bug.cgi?id=659164
2011-09-16 09:45:11 -04:00
Ray Strode
13bf64a53d popupMenu: Use new convenience method for settings
All the system status menus in the panel offer a
menu item to jump to a relevant part of the
control-center.

This means each status icon has the same, or nearly the
same bit of code to:

- Add a new "action" menu item and listen for its activation.
- Hide the overview if it's showing when the menu item is activated
- Find the relevant control-center panel from its desktop file
- Launch the control-center to the relevant panel

This commit consolidates all those details in a new method,
addSettingsAction.  This refactoring reduces code duplication and
slight inconsistencies in the code resulting from that duplication.
It will also make it easier in subsequent commits to hide settings menu
items when the shell is used in the login screen.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:16:04 -04:00
Giovanni Campagna
f99b4da4ec KeyboardStatus: disambiguate duplicate short descriptions
If two layouts have the same short description (for example, english
(US) and english (dvorak)), add a subscript for disambiguating
among them.

https://bugzilla.gnome.org/show_bug.cgi?id=650128
2011-08-26 16:52:58 +02:00
Colin Walters
4886275df4 ShellApp: Change activation API
Since almost all of the callers of shell_app_activate were using the
default workspace (by passing -1), remove that parameter.

Add a new shell_app_activate_full() API which takes a workspace as
well as a timestamp; previously we might have been ignoring event
timestamps from elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=648149
2011-08-11 05:35:23 -04:00
Colin Walters
10dcc100e9 Kill off ShellAppInfo, move into ShellApp
This dramatically thins down and sanitizes the application code.

The ShellAppSystem changes in a number of ways:
* Preferences are special cased more explicitly; they aren't apps,
  they're shortcuts for an app), and we don't have many of them, so
  don't need e.g. the optimizations in ShellAppSystem for searching.
* get_app() changes to lookup_app() and returns null if an app isn't
  found.  The semantics where it tried to find the .desktop file
  if we didn't know about it were just broken; I am pretty sure no
  caller needs this, and if they do we'll fix them.
* ShellAppSystem maintains two indexes on apps (by desktop file id
  and by GMenuTreeEntry), but is no longer in the business of
  dealing with GMenuTree as far as hierarchy and categories go.  That
  is moved up into js/ui/appDisplay.js.  Actually, it flattens both
  apps and settings.

Also, ShellWindowTracker is now the sole reference-owner for
window-backed apps.  We still do the weird "window:0x1234beef" id
for these apps, but a reference is not stored in ShellAppSystem.

The js/ui/appDisplay.js code is rewritten, and sucks a lot less.
Variable names are clearer:

_apps -> _appIcons
_filterApp -> _visibleApps
_filters -> _categoryBox

Similarly for function names.  We no longer call (for every app) a
recursive lookup in GMenuTree to see if it's in a particular section
on every category switch; it's all cached.

NOTE - this intentionally reverts the incremental loading code from
commit 7813c5b93f.  It's fast enough
here without that.

https://bugzilla.gnome.org/show_bug.cgi?id=648149
2011-08-10 12:59:32 -04:00
Jeremy Bicha
77556d181e Use "Region and Language Settings" label
Since this link in the keyboard menu points to Region and Language
Settings in System Settings, we should be consistent and use that
term instead of "Localization Settings"

Also, this removes ellipsis from "Show Keyboard Layout" since it
doesn't require further input.

https://bugzilla.gnome.org/show_bug.cgi?id=652984
2011-07-29 14:41:08 +02:00
Colin Walters
8834a7df10 Consistently exit the overview when launching external applications
We were doing this in one or two places, but not most of them.

https://bugzilla.gnome.org/show_bug.cgi?id=653095
2011-06-22 17:49:44 -04:00