Merge lp:~ubuntu-branches/ubuntu/oneiric/gnome-shell/oneiric-201109221311 into lp:ubuntu/oneiric/gnome-shell

Proposed by Ubuntu Package Importer
Status: Needs review
Proposed branch: lp:~ubuntu-branches/ubuntu/oneiric/gnome-shell/oneiric-201109221311
Merge into: lp:ubuntu/oneiric/gnome-shell
Diff against target: 564 lines (+544/-0) (has conflicts)
2 files modified
data/org.gnome.shell.gschema.xml.in (+4/-0)
js/ui/keyboard.js (+540/-0)
Text conflict in data/org.gnome.shell.gschema.xml.in
Contents conflict in js/ui/keyboard.js
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/oneiric/gnome-shell/oneiric-201109221311
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+76580@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archive and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/oneiric/gnome-shell reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/oneiric/gnome-shell/oneiric-201109221311. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

44. By Martin Pitt

releasing version 3.1.92-0ubuntu1

43. By Martin Pitt

debian/control.in: Add libjson-glib-dev build dependency as per
configure.ac.

42. By Martin Pitt

* New upstream release.
  - Adds browser plugin for installing, enabling, disabling, and
    uninstalling shell extensions. (Note that extensions.gnome.org
    isn't yet in operation.)
  - Lots of bugfixes
* debian/control.in:
  - Depend on caribou libraries
  - Recommend gnome-session-fallback, needed when graphics support
    test fails (LP: #852950)
  - Bump minimum gjs dependency to 1.29.18 and minimum mutter
    to 3.1.92
* debian/patches/01_favorite_apps.patch: Updated
* debian/patches/04_build-without-caribou.patch: Dropped

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure'
=== modified file 'configure.ac'
=== modified file 'data/org.gnome.shell.gschema.xml.in'
--- data/org.gnome.shell.gschema.xml.in 2011-09-22 08:50:45 +0000
+++ data/org.gnome.shell.gschema.xml.in 2011-09-22 13:16:23 +0000
@@ -31,7 +31,11 @@
31 </_description>31 </_description>
32 </key>32 </key>
33 <key name="favorite-apps" type="as">33 <key name="favorite-apps" type="as">
34<<<<<<< TREE
34 <default>[ 'firefox.desktop', 'thunderbird.desktop', 'empathy.desktop', 'banshee.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop' ]</default>35 <default>[ 'firefox.desktop', 'thunderbird.desktop', 'empathy.desktop', 'banshee.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop' ]</default>
36=======
37 <default>[ 'epiphany.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop' ]</default>
38>>>>>>> MERGE-SOURCE
35 <_summary>List of desktop file IDs for favorite applications</_summary>39 <_summary>List of desktop file IDs for favorite applications</_summary>
36 <_description>40 <_description>
37 The applications corresponding to these identifiers41 The applications corresponding to these identifiers
3842
=== added file 'js/ui/keyboard.js'
--- js/ui/keyboard.js 1970-01-01 00:00:00 +0000
+++ js/ui/keyboard.js 2011-09-22 13:16:23 +0000
@@ -0,0 +1,540 @@
1/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
2
3const Caribou = imports.gi.Caribou;
4const Clutter = imports.gi.Clutter;
5const DBus = imports.dbus;
6const Gdk = imports.gi.Gdk;
7const Gio = imports.gi.Gio;
8const GLib = imports.gi.GLib;
9const Lang = imports.lang;
10const Shell = imports.gi.Shell;
11const St = imports.gi.St;
12
13const BoxPointer = imports.ui.boxpointer;
14const Main = imports.ui.main;
15const MessageTray = imports.ui.messageTray;
16
17const KEYBOARD_SCHEMA = 'org.gnome.shell.keyboard';
18const KEYBOARD_TYPE = 'keyboard-type';
19
20const A11Y_APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
21const SHOW_KEYBOARD = 'screen-keyboard-enabled';
22
23// Key constants taken from Antler
24// FIXME: ought to be moved into libcaribou
25const PRETTY_KEYS = {
26 'BackSpace': '\u232b',
27 'space': ' ',
28 'Return': '\u23ce',
29 'Caribou_Prefs': '\u2328',
30 'Caribou_ShiftUp': '\u2b06',
31 'Caribou_ShiftDown': '\u2b07',
32 'Caribou_Emoticons': '\u263a',
33 'Caribou_Symbols': '123',
34 'Caribou_Symbols_More': '{#*',
35 'Caribou_Alpha': 'Abc',
36 'Tab': 'Tab',
37 'Escape': 'Esc',
38 'Control_L': 'Ctrl',
39 'Alt_L': 'Alt'
40};
41
42const CaribouKeyboardIface = {
43 name: 'org.gnome.Caribou.Keyboard',
44 methods: [ { name: 'Show',
45 inSignature: 'u',
46 outSignature: ''
47 },
48 { name: 'Hide',
49 inSignature: 'u',
50 outSignature: ''
51 },
52 { name: 'SetCursorLocation',
53 inSignature: 'iiii',
54 outSignature: ''
55 },
56 { name: 'SetEntryLocation',
57 inSignature: 'iiii',
58 outSignature: ''
59 } ],
60 properties: [ { name: 'Name',
61 signature: 's',
62 access: 'read' } ]
63};
64
65function Key() {
66 this._init.apply(this, arguments);
67}
68
69Key.prototype = {
70 _init : function(key) {
71 this._key = key;
72
73 this.actor = this._makeKey();
74
75 this._extended_keys = this._key.get_extended_keys();
76 this._extended_keyboard = null;
77
78 if (this._key.name == "Control_L" || this._key.name == "Alt_L")
79 this._key.latch = true;
80
81 this._key.connect('key-pressed', Lang.bind(this, function ()
82 { this.actor.checked = true }));
83 this._key.connect('key-released', Lang.bind(this, function ()
84 { this.actor.checked = false; }));
85
86 if (this._extended_keys.length > 0) {
87 this._grabbed = false;
88 this._eventCaptureId = 0;
89 this._key.connect('notify::show-subkeys', Lang.bind(this, this._onShowSubkeysChanged));
90 this._boxPointer = new BoxPointer.BoxPointer(St.Side.BOTTOM,
91 { x_fill: true,
92 y_fill: true,
93 x_align: St.Align.START });
94 // Adds style to existing keyboard style to avoid repetition
95 this._boxPointer.actor.add_style_class_name('keyboard-subkeys');
96 this._getExtendedKeys();
97 this.actor._extended_keys = this._extended_keyboard;
98 this._boxPointer.actor.hide();
99 Main.layoutManager.addChrome(this._boxPointer.actor, { visibleInFullscreen: true });
100 }
101 },
102
103 _makeKey: function () {
104 let label = this._key.name;
105
106 if (label.length > 1) {
107 let pretty = PRETTY_KEYS[label];
108 if (pretty)
109 label = pretty;
110 else
111 label = this._getUnichar(this._key);
112 }
113
114 label = GLib.markup_escape_text(label, -1);
115 let button = new St.Button ({ label: label,
116 style_class: 'keyboard-key' });
117
118 button.key_width = this._key.width;
119 button.connect('button-press-event', Lang.bind(this, function () { this._key.press(); }));
120 button.connect('button-release-event', Lang.bind(this, function () { this._key.release(); }));
121
122 return button;
123 },
124
125 _getUnichar: function(key) {
126 let keyval = key.keyval;
127 let unichar = Gdk.keyval_to_unicode(keyval);
128 if (unichar) {
129 return String.fromCharCode(unichar);
130 } else {
131 return key.name;
132 }
133 },
134
135 _getExtendedKeys: function () {
136 this._extended_keyboard = new St.BoxLayout({ style_class: 'keyboard-layout',
137 vertical: false });
138 for (let i = 0; i < this._extended_keys.length; ++i) {
139 let extended_key = this._extended_keys[i];
140 let label = this._getUnichar(extended_key);
141 let key = new St.Button({ label: label, style_class: 'keyboard-key' });
142 key.extended_key = extended_key;
143 key.connect('button-press-event', Lang.bind(this, function () { extended_key.press(); }));
144 key.connect('button-release-event', Lang.bind(this, function () { extended_key.release(); }));
145 this._extended_keyboard.add(key);
146 }
147 this._boxPointer.bin.add_actor(this._extended_keyboard);
148 },
149
150 _onEventCapture: function (actor, event) {
151 let source = event.get_source();
152 let type = event.type();
153
154 if ((type == Clutter.EventType.BUTTON_PRESS ||
155 type == Clutter.EventType.BUTTON_RELEASE) &&
156 this._extended_keyboard.contains(source)) {
157 source.extended_key.press();
158 source.extended_key.release();
159 return false;
160 }
161 if (type == Clutter.EventType.BUTTON_PRESS) {
162 this._boxPointer.actor.hide();
163 this._ungrab();
164 return true;
165 }
166 return false;
167 },
168
169 _ungrab: function () {
170 global.stage.disconnect(this._eventCaptureId);
171 this._eventCaptureId = 0;
172 this._grabbed = false;
173 Main.popModal(this.actor);
174 },
175
176 _onShowSubkeysChanged: function () {
177 if (this._key.show_subkeys) {
178 this.actor.fake_release();
179 this._boxPointer.actor.raise_top();
180 this._boxPointer.setPosition(this.actor, 0.5);
181 this._boxPointer.show(true);
182 this.actor.set_hover(false);
183 if (!this._grabbed) {
184 Main.pushModal(this.actor);
185 this._eventCaptureId = global.stage.connect('captured-event', Lang.bind(this, this._onEventCapture));
186 this._grabbed = true;
187 }
188 this._key.release();
189 } else {
190 if (this._grabbed)
191 this._ungrab();
192 this._boxPointer.hide(true);
193 }
194 }
195};
196
197function Keyboard() {
198 this._init.apply(this, arguments);
199}
200
201Keyboard.prototype = {
202 _init: function () {
203 DBus.session.exportObject('/org/gnome/Caribou/Keyboard', this);
204
205 this.actor = null;
206
207 this._timestamp = global.get_current_time();
208 Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._redraw));
209
210 this._keyboardSettings = new Gio.Settings({ schema: KEYBOARD_SCHEMA });
211 this._keyboardSettings.connect('changed', Lang.bind(this, this._settingsChanged));
212 this._a11yApplicationsSettings = new Gio.Settings({ schema: A11Y_APPLICATIONS_SCHEMA });
213 this._a11yApplicationsSettings.connect('changed', Lang.bind(this, this._settingsChanged));
214 this._settingsChanged();
215 },
216
217 init: function () {
218 this._redraw();
219 },
220
221 _settingsChanged: function () {
222 this._enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
223 if (!this._enableKeyboard && !this._keyboard)
224 return;
225 if (this._enableKeyboard && this._keyboard &&
226 this._keyboard.keyboard_type == this._keyboardSettings.get_string(KEYBOARD_TYPE))
227 return;
228
229 if (this._keyboard)
230 this._destroyKeyboard();
231 if (this._enableKeyboard)
232 this._setupKeyboard();
233 else
234 Main.layoutManager.hideKeyboard(true);
235 },
236
237 _destroyKeyboard: function() {
238 if (this._keyboardNotifyId)
239 this._keyboard.disconnect(this._keyboardNotifyId);
240 if (this._focusNotifyId)
241 global.stage.disconnect(this._focusNotifyId);
242 this._keyboard = null;
243 this.actor.destroy();
244 this.actor = null;
245
246 this._destroySource();
247 },
248
249 _setupKeyboard: function() {
250 this.actor = new St.BoxLayout({ name: 'keyboard', vertical: true, reactive: true });
251 Main.layoutManager.keyboardBox.add_actor(this.actor);
252 Main.layoutManager.trackChrome(this.actor);
253
254 this._keyboard = new Caribou.KeyboardModel({ keyboard_type: this._keyboardSettings.get_string(KEYBOARD_TYPE) });
255 this._groups = {};
256 this._current_page = null;
257
258 // Initialize keyboard key measurements
259 this._numOfHorizKeys = 0;
260 this._numOfVertKeys = 0;
261
262 this._addKeys();
263
264 this._keyboardNotifyId = this._keyboard.connect('notify::active-group', Lang.bind(this, this._onGroupChanged));
265 this._focusNotifyId = global.stage.connect('notify::key-focus', Lang.bind(this, this._onKeyFocusChanged));
266 this._createSource();
267 },
268
269 _onKeyFocusChanged: function () {
270 let focus = global.stage.key_focus;
271
272 // Showing an extended key popup will grab focus, but ignore that
273 if (focus && focus._extended_keys)
274 return;
275
276 if (focus instanceof Clutter.Text)
277 this.show();
278 else
279 this.hide();
280 },
281
282 _addKeys: function () {
283 let groups = this._keyboard.get_groups();
284 for (let i = 0; i < groups.length; ++i) {
285 let gname = groups[i];
286 let group = this._keyboard.get_group(gname);
287 group.connect('notify::active-level', Lang.bind(this, this._onLevelChanged));
288 let layers = {};
289 let levels = group.get_levels();
290 for (let j = 0; j < levels.length; ++j) {
291 let lname = levels[j];
292 let level = group.get_level(lname);
293 let layout = new St.BoxLayout({ style_class: 'keyboard-layout',
294 vertical: true });
295 this._loadRows(level, layout);
296 layers[lname] = layout;
297 this.actor.add(layout, { x_fill: false });
298
299 layout.hide();
300 }
301 this._groups[gname] = layers;
302 }
303
304 this._setActiveLayer();
305 },
306
307 _getTrayIcon: function () {
308 let trayButton = new St.Button ({ label: "tray", style_class: 'keyboard-key' });
309 trayButton.key_width = 1;
310 trayButton.connect('button-press-event', Lang.bind(this, function () {
311 Main.messageTray.toggle();
312 }));
313
314 Main.overview.connect('showing', Lang.bind(this, function () {
315 trayButton.reactive = false;
316 trayButton.add_style_pseudo_class('grayed');
317 }));
318 Main.overview.connect('hiding', Lang.bind(this, function () {
319 trayButton.reactive = true;
320 trayButton.remove_style_pseudo_class('grayed');
321 }));
322
323 return trayButton;
324 },
325
326 _addRows : function (keys, layout) {
327 let keyboard_row = new St.BoxLayout();
328 for (let i = 0; i < keys.length; ++i) {
329 let children = keys[i].get_children();
330 let right_box = new St.BoxLayout({ style_class: 'keyboard-row' });
331 let left_box = new St.BoxLayout({ style_class: 'keyboard-row' });
332 for (let j = 0; j < children.length; ++j) {
333 if (this._numOfHorizKeys == 0)
334 this._numOfHorizKeys = children.length;
335 let key = children[j];
336 let button = new Key(key);
337
338 if (key.align == 'right')
339 right_box.add(button.actor);
340 else
341 left_box.add(button.actor);
342 if (key.name == "Caribou_Prefs") {
343 key.connect('key-released', Lang.bind(this, this.hide));
344
345 // Add new key for hiding message tray
346 right_box.add(this._getTrayIcon());
347 }
348 }
349 keyboard_row.add(left_box, { expand: true, x_fill: false, x_align: St.Align.START });
350 keyboard_row.add(right_box, { expand: true, x_fill: false, x_align: St.Align.END });
351 }
352 layout.add(keyboard_row);
353 },
354
355 _loadRows : function (level, layout) {
356 let rows = level.get_rows();
357 for (let i = 0; i < rows.length; ++i) {
358 let row = rows[i];
359 if (this._numOfVertKeys == 0)
360 this._numOfVertKeys = rows.length;
361 this._addRows(row.get_columns(), layout);
362 }
363
364 },
365
366 _redraw: function () {
367 if (!this._enableKeyboard)
368 return;
369
370 let monitor = Main.layoutManager.bottomMonitor;
371 let maxHeight = monitor.height / 3;
372 this.actor.width = monitor.width;
373
374 let layout = this._current_page;
375 let verticalSpacing = layout.get_theme_node().get_length('spacing');
376 let padding = layout.get_theme_node().get_length('padding');
377
378 let box = layout.get_children()[0].get_children()[0];
379 let horizontalSpacing = box.get_theme_node().get_length('spacing');
380 let allHorizontalSpacing = (this._numOfHorizKeys - 1) * horizontalSpacing;
381 let keyWidth = Math.floor((this.actor.width - allHorizontalSpacing - 2 * padding) / this._numOfHorizKeys);
382
383 let allVerticalSpacing = (this._numOfVertKeys - 1) * verticalSpacing;
384 let keyHeight = Math.floor((maxHeight - allVerticalSpacing - 2 * padding) / this._numOfVertKeys);
385
386 let keySize = Math.min(keyWidth, keyHeight);
387 this.actor.height = keySize * this._numOfVertKeys + allVerticalSpacing + 2 * padding;
388
389 let rows = this._current_page.get_children();
390 for (let i = 0; i < rows.length; ++i) {
391 let keyboard_row = rows[i];
392 let boxes = keyboard_row.get_children();
393 for (let j = 0; j < boxes.length; ++j) {
394 let keys = boxes[j].get_children();
395 for (let k = 0; k < keys.length; ++k) {
396 let child = keys[k];
397 child.width = keySize * child.key_width;
398 child.height = keySize;
399 if (child._extended_keys) {
400 let extended_keys = child._extended_keys.get_children();
401 for (let n = 0; n < extended_keys.length; ++n) {
402 let extended_key = extended_keys[n];
403 extended_key.width = keySize;
404 extended_key.height = keySize;
405 }
406 }
407 }
408 }
409 }
410 },
411
412 _onLevelChanged: function () {
413 this._setActiveLayer();
414 this._redraw();
415 },
416
417 _onGroupChanged: function () {
418 this._setActiveLayer();
419 this._redraw();
420 },
421
422 _setActiveLayer: function () {
423 let active_group_name = this._keyboard.active_group;
424 let active_group = this._keyboard.get_group(active_group_name);
425 let active_level = active_group.active_level;
426 let layers = this._groups[active_group_name];
427
428 if (this._current_page != null) {
429 this._current_page.hide();
430 }
431
432 this._current_page = layers[active_level];
433 this._current_page.show();
434 },
435
436 _createSource: function () {
437 if (this._source == null) {
438 this._source = new KeyboardSource(this);
439 this._source.setTransient(true);
440 Main.messageTray.add(this._source);
441 }
442 },
443
444 _destroySource: function () {
445 if (this._source) {
446 this._source.destroy();
447 this._source = null;
448 }
449 },
450
451 show: function () {
452 this._redraw();
453
454 Main.layoutManager.showKeyboard();
455 this._destroySource();
456 },
457
458 hide: function () {
459 Main.layoutManager.hideKeyboard();
460 this._createSource();
461 },
462
463 _moveTemporarily: function () {
464 let currentWindow = global.screen.get_display().focus_window;
465 let rect = currentWindow.get_outer_rect();
466
467 let newX = rect.x;
468 let newY = 3 * this.actor.height / 2;
469 currentWindow.move_frame(true, newX, newY);
470 },
471
472 _setLocation: function (x, y) {
473 if (y >= 2 * this.actor.height)
474 this._moveTemporarily();
475 },
476
477 // D-Bus methods
478 Show: function(timestamp) {
479 if (timestamp - this._timestamp < 0)
480 return;
481
482 this._timestamp = timestamp;
483 this.show();
484 },
485
486 Hide: function(timestamp) {
487 if (timestamp - this._timestamp < 0)
488 return;
489
490 this._timestamp = timestamp;
491 this.hide();
492 },
493
494 SetCursorLocation: function(x, y, w, h) {
495 this._setLocation(x, y);
496 },
497
498 SetEntryLocation: function(x, y, w, h) {
499 this._setLocation(x, y);
500 },
501
502 get Name() {
503 return 'gnome-shell';
504 }
505};
506DBus.conformExport(Keyboard.prototype, CaribouKeyboardIface);
507
508function KeyboardSource() {
509 this._init.apply(this, arguments);
510}
511
512KeyboardSource.prototype = {
513 __proto__: MessageTray.Source.prototype,
514
515 _init: function(keyboard) {
516 this._keyboard = keyboard;
517 MessageTray.Source.prototype._init.call(this, _("Keyboard"));
518
519 this._setSummaryIcon(this.createNotificationIcon());
520 },
521
522 createNotificationIcon: function() {
523 return new St.Icon({ icon_name: 'input-keyboard',
524 icon_type: St.IconType.SYMBOLIC,
525 icon_size: this.ICON_SIZE });
526 },
527
528 handleSummaryClick: function() {
529 let event = Clutter.get_current_event();
530 if (event.type() != Clutter.EventType.BUTTON_RELEASE)
531 return false;
532
533 this.open();
534 return true;
535 },
536
537 open: function() {
538 this._keyboard.show();
539 }
540};
0541
=== renamed file 'js/ui/keyboard.js' => 'js/ui/keyboard.js.THIS'

Subscribers

People subscribed via source and target branches

to all changes: