Compare commits
26 Commits
wip/fmuell
...
wip/carlos
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7f66aede01 | ||
![]() |
bd5a1121d6 | ||
![]() |
03117d65b2 | ||
![]() |
5520bb3890 | ||
![]() |
4e6b2eb72a | ||
![]() |
2e5295b3a9 | ||
![]() |
3121c9aa29 | ||
![]() |
1ebbd7c768 | ||
![]() |
8572bb97c7 | ||
![]() |
d5ebd8c816 | ||
![]() |
ed999ce926 | ||
![]() |
50b7739076 | ||
![]() |
94995e9c1e | ||
![]() |
fb04dafb0b | ||
![]() |
d57234bec9 | ||
![]() |
38da54fb02 | ||
![]() |
bbd3275dad | ||
![]() |
3a3f9aa008 | ||
![]() |
3c54e863e6 | ||
![]() |
a63ba61194 | ||
![]() |
ab9710ee7b | ||
![]() |
43cef45229 | ||
![]() |
8db4f3c67f | ||
![]() |
594a070029 | ||
![]() |
c2e04e3cfa | ||
![]() |
293f50e8e5 |
@@ -17,15 +17,19 @@ if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
||||
merge_request_branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
||||
|
||||
echo Looking for $merge_request_branch on remote ...
|
||||
if git fetch $merge_request_remote $merge_request_branch >/dev/null 2>&1; then
|
||||
if git fetch -q $merge_request_remote $merge_request_branch 2>/dev/null; then
|
||||
mutter_target=FETCH_HEAD
|
||||
else
|
||||
mutter_target=origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
||||
echo Using $mutter_target instead
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$mutter_target" ]; then
|
||||
mutter_target=$(git branch -r -l $shell_branch)
|
||||
mutter_target=$(git branch -r -l origin/$shell_branch)
|
||||
mutter_target=${mutter_target:-$(git branch -r -l ${shell_branch#remotes/})}
|
||||
mutter_target=${mutter_target:-origin/master}
|
||||
echo Using $mutter_target instead
|
||||
fi
|
||||
|
||||
git checkout $mutter_target
|
||||
git checkout -q $mutter_target
|
||||
|
@@ -477,8 +477,8 @@ var CyclerList = GObject.registerClass({
|
||||
var CyclerPopup = GObject.registerClass(
|
||||
class CyclerPopup extends SwitcherPopup.SwitcherPopup {
|
||||
_init() {
|
||||
if (new.target === CyclerPopup)
|
||||
throw new TypeError('Cannot instantiate abstract class ' + new.target.name);
|
||||
if (this.constructor.name === CyclerPopup.prototype.constructor.name)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
|
||||
super._init();
|
||||
|
||||
|
@@ -98,8 +98,8 @@ function clamp(value, min, max) {
|
||||
|
||||
class BaseAppView {
|
||||
constructor(params, gridParams) {
|
||||
if (new.target === BaseAppView)
|
||||
throw new TypeError('Cannot instantiate abstract class ' + new.target.name);
|
||||
if (this.constructor === BaseAppView)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
|
||||
gridParams = Params.parse(gridParams, { xAlign: St.Align.MIDDLE,
|
||||
columnLimit: MAX_COLUMNS,
|
||||
|
@@ -118,7 +118,7 @@ var WorldClocksSection = class WorldClocksSection {
|
||||
if (!clocks[i].location)
|
||||
continue;
|
||||
let l = world.deserialize(clocks[i].location);
|
||||
if (l)
|
||||
if (l && l.get_timezone() != null)
|
||||
this._locations.push({ location: l });
|
||||
}
|
||||
|
||||
|
@@ -175,10 +175,10 @@ var MessageDialogContent = GObject.registerClass({
|
||||
this[`_${prop}`].add_style_class_name(`message-dialog-${prop}`);
|
||||
});
|
||||
|
||||
let textProps = { ellipsize_mode: Pango.EllipsizeMode.NONE,
|
||||
let textProps = { ellipsize: Pango.EllipsizeMode.NONE,
|
||||
line_wrap: true };
|
||||
Object.assign(this._subtitle.clutter_text, textProps);
|
||||
Object.assign(this._body.clutter_text, textProps);
|
||||
this._subtitle.clutter_text.set(textProps);
|
||||
this._body.clutter_text.set(textProps);
|
||||
|
||||
if (!params.hasOwnProperty('style_class'))
|
||||
params.style_class = 'message-dialog-main-layout';
|
||||
|
@@ -1049,7 +1049,7 @@ var Keyboard = class Keyboard {
|
||||
this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this));
|
||||
this._lastDeviceId = null;
|
||||
this._suggestions = null;
|
||||
this._emojiKeyVisible = true;
|
||||
this._emojiKeyVisible = Meta.is_wayland_compositor();
|
||||
|
||||
this._focusTracker = new FocusTracker();
|
||||
this._focusTracker.connect('position-changed', this._onFocusPositionChanged.bind(this));
|
||||
@@ -1162,7 +1162,7 @@ var Keyboard = class Keyboard {
|
||||
this._keyboardController = new KeyboardController();
|
||||
|
||||
this._groups = {};
|
||||
this._current_page = null;
|
||||
this._currentPage = null;
|
||||
|
||||
this._suggestions = new Suggestions();
|
||||
this.actor.add(this._suggestions.actor,
|
||||
@@ -1202,10 +1202,12 @@ var Keyboard = class Keyboard {
|
||||
this._keyboardNotifyId = this._keyboardController.connect('active-group', this._onGroupChanged.bind(this));
|
||||
this._keyboardGroupsChangedId = this._keyboardController.connect('groups-changed', this._onKeyboardGroupsChanged.bind(this));
|
||||
this._keyboardStateId = this._keyboardController.connect('panel-state', this._onKeyboardStateChanged.bind(this));
|
||||
this._emojiKeyVisibleId = this._keyboardController.connect('emoji-visible', this._onEmojiKeyVisible.bind(this));
|
||||
this._keypadVisibleId = this._keyboardController.connect('keypad-visible', this._onKeypadVisible.bind(this));
|
||||
this._focusNotifyId = global.stage.connect('notify::key-focus', this._onKeyFocusChanged.bind(this));
|
||||
|
||||
if (Meta.is_wayland_compositor())
|
||||
this._emojiKeyVisibleId = this._keyboardController.connect('emoji-visible', this._onEmojiKeyVisible.bind(this));
|
||||
|
||||
this._relayout();
|
||||
}
|
||||
|
||||
@@ -1353,7 +1355,7 @@ var Keyboard = class Keyboard {
|
||||
} else if (switchToLevel == 1) {
|
||||
extraButton.connect('long-press', () => {
|
||||
this._latched = true;
|
||||
this._setCurrentLevelLatched(this._current_page, this._latched);
|
||||
this._setCurrentLevelLatched(this._currentPage, this._latched);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1380,8 +1382,8 @@ var Keyboard = class Keyboard {
|
||||
}
|
||||
|
||||
_updateCurrentPageVisible() {
|
||||
if (this._current_page)
|
||||
this._current_page.visible = !this._emojiActive && !this._keypadVisible;
|
||||
if (this._currentPage)
|
||||
this._currentPage.visible = !this._emojiActive && !this._keypadVisible;
|
||||
}
|
||||
|
||||
_setEmojiActive(active) {
|
||||
@@ -1440,7 +1442,7 @@ var Keyboard = class Keyboard {
|
||||
|
||||
_getGridSlots() {
|
||||
let numOfHorizSlots = 0, numOfVertSlots;
|
||||
let rows = this._current_page.get_children();
|
||||
let rows = this._currentPage.get_children();
|
||||
numOfVertSlots = rows.length;
|
||||
|
||||
for (let i = 0; i < rows.length; ++i) {
|
||||
@@ -1470,7 +1472,13 @@ var Keyboard = class Keyboard {
|
||||
}
|
||||
|
||||
_onKeyboardGroupsChanged(keyboard) {
|
||||
this._groups = [];
|
||||
let nonGroupActors = [this._emojiSelection.actor, this._keypad.actor];
|
||||
this._aspectContainer.get_children().filter(c => !nonGroupActors.includes(c)).forEach(c => {
|
||||
c.destroy();
|
||||
});
|
||||
|
||||
this._currentPage = null;
|
||||
this._groups = {};
|
||||
this._onGroupChanged();
|
||||
}
|
||||
|
||||
@@ -1513,12 +1521,12 @@ var Keyboard = class Keyboard {
|
||||
let activeGroupName = this._keyboardController.getCurrentGroup();
|
||||
let layers = this._groups[activeGroupName];
|
||||
|
||||
if (this._current_page != null) {
|
||||
this._setCurrentLevelLatched(this._current_page, false);
|
||||
this._current_page.hide();
|
||||
if (this._currentPage != null) {
|
||||
this._setCurrentLevelLatched(this._currentPage, false);
|
||||
this._currentPage.hide();
|
||||
}
|
||||
|
||||
this._current_page = layers[activeLevel];
|
||||
this._currentPage = layers[activeLevel];
|
||||
this._updateCurrentPageVisible();
|
||||
}
|
||||
|
||||
|
@@ -369,17 +369,15 @@ class DashSpacer extends St.Widget {
|
||||
}
|
||||
|
||||
vfunc_get_preferred_width(forHeight) {
|
||||
let box = this.get_allocation_box();
|
||||
let minWidth = super.vfunc_get_preferred_width(forHeight)[0];
|
||||
let natWidth = box.x2 - box.x1;
|
||||
return [minWidth, natWidth];
|
||||
if (this._bindConstraint)
|
||||
return this._bindConstraint.source.get_preferred_width(forHeight);
|
||||
return super.vfunc_get_preferred_width(forHeight);
|
||||
}
|
||||
|
||||
vfunc_get_preferred_height(forWidth) {
|
||||
let box = this.get_allocation_box();
|
||||
let minHeight = super.vfunc_get_preferred_height(forWidth)[0];
|
||||
let natHeight = box.y2 - box.y1;
|
||||
return [minHeight, natHeight];
|
||||
if (this._bindConstraint)
|
||||
return this._bindConstraint.source.get_preferred_height(forWidth);
|
||||
return super.vfunc_get_preferred_height(forWidth);
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -374,12 +374,12 @@ var PadDiagram = GObject.registerClass({
|
||||
svgData += this._cssString();
|
||||
svgData += this._wrappingSvgFooter();
|
||||
|
||||
let handle = new Rsvg.Handle();
|
||||
handle.set_base_uri(GLib.path_get_dirname(this._imagePath));
|
||||
handle.write(svgData);
|
||||
handle.close();
|
||||
let istream = new Gio.MemoryInputStream();
|
||||
istream.add_bytes(new GLib.Bytes(svgData));
|
||||
|
||||
return handle;
|
||||
return Rsvg.Handle.new_from_stream_sync(istream,
|
||||
Gio.File.new_for_path(this._imagePath),
|
||||
0, null);
|
||||
}
|
||||
|
||||
_updateDiagramScale() {
|
||||
|
@@ -877,7 +877,7 @@ class Panel extends St.Widget {
|
||||
}
|
||||
|
||||
vfunc_allocate(box, flags) {
|
||||
super.vfunc_allocate(box, flags);
|
||||
this.set_allocation(box, flags);
|
||||
|
||||
let allocWidth = box.x2 - box.x1;
|
||||
let allocHeight = box.y2 - box.y1;
|
||||
@@ -971,22 +971,11 @@ class Panel extends St.Widget {
|
||||
if (isPress && button != 1)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
let focusWindow = global.display.focus_window;
|
||||
if (!focusWindow)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
let dragWindow = focusWindow.is_attached_dialog() ? focusWindow.get_transient_for()
|
||||
: focusWindow;
|
||||
if (!dragWindow)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
let rect = dragWindow.get_frame_rect();
|
||||
let [stageX, stageY] = event.get_coords();
|
||||
|
||||
let allowDrag = dragWindow.maximized_vertically &&
|
||||
stageX > rect.x && stageX < rect.x + rect.width;
|
||||
let dragWindow = this._getDraggableWindowForPosition(stageX);
|
||||
|
||||
if (!allowDrag)
|
||||
if (!dragWindow)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
global.display.begin_grab_op(dragWindow,
|
||||
@@ -1196,4 +1185,21 @@ class Panel extends St.Widget {
|
||||
Main.messageTray.bannerBlocked = isOpen;
|
||||
});
|
||||
}
|
||||
|
||||
_getDraggableWindowForPosition(stageX) {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
let workspace = workspaceManager.get_active_workspace()
|
||||
let allWindowsByStacking = global.display.sort_windows_by_stacking(
|
||||
workspace.list_windows()
|
||||
).reverse();
|
||||
|
||||
return allWindowsByStacking.find(metaWindow => {
|
||||
let rect = metaWindow.get_frame_rect();
|
||||
return metaWindow.is_on_primary_monitor() &&
|
||||
metaWindow.showing_on_its_workspace() &&
|
||||
metaWindow.get_window_type() != Meta.WindowType.DESKTOP &&
|
||||
metaWindow.maximized_vertically &&
|
||||
stageX > rect.x && stageX < rect.x + rect.width
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -397,8 +397,8 @@ var PopupImageMenuItem = class extends PopupBaseMenuItem {
|
||||
|
||||
var PopupMenuBase = class {
|
||||
constructor(sourceActor, styleClass) {
|
||||
if (new.target === PopupMenuBase)
|
||||
throw new TypeError('Cannot instantiate abstract class ' + new.target.name);
|
||||
if (this.constructor === PopupMenuBase)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
|
||||
this.sourceActor = sourceActor;
|
||||
this._parent = null;
|
||||
|
@@ -112,38 +112,22 @@ class ATIndicator extends PanelMenu.Button {
|
||||
|
||||
_buildItem(string, schema, key) {
|
||||
let settings = new Gio.Settings({ schema_id: schema });
|
||||
settings.connect('changed::'+key, () => {
|
||||
let widget = this._buildItemExtended(string,
|
||||
settings.get_boolean(key),
|
||||
settings.is_writable(key),
|
||||
enabled => settings.set_boolean(key, enabled));
|
||||
|
||||
settings.connect('changed::' + key, () => {
|
||||
widget.setToggleState(settings.get_boolean(key));
|
||||
|
||||
this._queueSyncMenuVisibility();
|
||||
});
|
||||
|
||||
let widget = this._buildItemExtended(string,
|
||||
settings.get_boolean(key),
|
||||
settings.is_writable(key),
|
||||
enabled => settings.set_boolean(key, enabled));
|
||||
return widget;
|
||||
}
|
||||
|
||||
_buildHCItem() {
|
||||
let interfaceSettings = new Gio.Settings({ schema_id: DESKTOP_INTERFACE_SCHEMA });
|
||||
interfaceSettings.connect('changed::' + KEY_GTK_THEME, () => {
|
||||
let value = interfaceSettings.get_string(KEY_GTK_THEME);
|
||||
if (value == HIGH_CONTRAST_THEME) {
|
||||
highContrast.setToggleState(true);
|
||||
} else {
|
||||
highContrast.setToggleState(false);
|
||||
gtkTheme = value;
|
||||
}
|
||||
|
||||
this._queueSyncMenuVisibility();
|
||||
});
|
||||
interfaceSettings.connect('changed::' + KEY_ICON_THEME, () => {
|
||||
let value = interfaceSettings.get_string(KEY_ICON_THEME);
|
||||
if (value != HIGH_CONTRAST_THEME)
|
||||
iconTheme = value;
|
||||
});
|
||||
|
||||
let gtkTheme = interfaceSettings.get_string(KEY_GTK_THEME);
|
||||
let iconTheme = interfaceSettings.get_string(KEY_ICON_THEME);
|
||||
let hasHC = (gtkTheme == HIGH_CONTRAST_THEME);
|
||||
@@ -164,19 +148,30 @@ class ATIndicator extends PanelMenu.Button {
|
||||
interfaceSettings.reset(KEY_ICON_THEME);
|
||||
}
|
||||
});
|
||||
|
||||
interfaceSettings.connect('changed::' + KEY_GTK_THEME, () => {
|
||||
let value = interfaceSettings.get_string(KEY_GTK_THEME);
|
||||
if (value == HIGH_CONTRAST_THEME) {
|
||||
highContrast.setToggleState(true);
|
||||
} else {
|
||||
highContrast.setToggleState(false);
|
||||
gtkTheme = value;
|
||||
}
|
||||
|
||||
this._queueSyncMenuVisibility();
|
||||
});
|
||||
|
||||
interfaceSettings.connect('changed::' + KEY_ICON_THEME, () => {
|
||||
let value = interfaceSettings.get_string(KEY_ICON_THEME);
|
||||
if (value != HIGH_CONTRAST_THEME)
|
||||
iconTheme = value;
|
||||
});
|
||||
|
||||
return highContrast;
|
||||
}
|
||||
|
||||
_buildFontItem() {
|
||||
let settings = new Gio.Settings({ schema_id: DESKTOP_INTERFACE_SCHEMA });
|
||||
settings.connect('changed::' + KEY_TEXT_SCALING_FACTOR, () => {
|
||||
let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
|
||||
let active = (factor > 1.0);
|
||||
widget.setToggleState(active);
|
||||
|
||||
this._queueSyncMenuVisibility();
|
||||
});
|
||||
|
||||
let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
|
||||
let initial_setting = (factor > 1.0);
|
||||
let widget = this._buildItemExtended(_("Large Text"),
|
||||
@@ -189,6 +184,15 @@ class ATIndicator extends PanelMenu.Button {
|
||||
else
|
||||
settings.reset(KEY_TEXT_SCALING_FACTOR);
|
||||
});
|
||||
|
||||
settings.connect('changed::' + KEY_TEXT_SCALING_FACTOR, () => {
|
||||
let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
|
||||
let active = (factor > 1.0);
|
||||
widget.setToggleState(active);
|
||||
|
||||
this._queueSyncMenuVisibility();
|
||||
});
|
||||
|
||||
return widget;
|
||||
}
|
||||
});
|
||||
|
@@ -125,8 +125,8 @@ class InputSourceSwitcher extends SwitcherPopup.SwitcherList {
|
||||
|
||||
var InputSourceSettings = class {
|
||||
constructor() {
|
||||
if (new.target === InputSourceSettings)
|
||||
throw new TypeError('Cannot instantiate abstract class ' + new.target.name);
|
||||
if (this.constructor === InputSourceSettings)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
}
|
||||
|
||||
_emitInputSourcesChanged() {
|
||||
|
@@ -167,10 +167,10 @@ var NMConnectionItem = class {
|
||||
};
|
||||
Signals.addSignalMethods(NMConnectionItem.prototype);
|
||||
|
||||
var NMConnectionSection = class {
|
||||
var NMConnectionSection = class NMConnectionSection {
|
||||
constructor(client) {
|
||||
if (new.target === NMConnectionSection)
|
||||
throw new TypeError('Cannot instantiate abstract type ' + new.target.name);
|
||||
if (this.constructor === NMConnectionSection)
|
||||
throw new TypeError(`Cannot instantiate abstract type ${this.constructor.name}`);
|
||||
|
||||
this._client = client;
|
||||
|
||||
@@ -297,12 +297,13 @@ var NMConnectionSection = class {
|
||||
};
|
||||
Signals.addSignalMethods(NMConnectionSection.prototype);
|
||||
|
||||
var NMConnectionDevice = class extends NMConnectionSection {
|
||||
var NMConnectionDevice = class NMConnectionDevice extends NMConnectionSection {
|
||||
constructor(client, device) {
|
||||
if (new.target === NMConnectionDevice)
|
||||
throw new TypeError('Cannot instantiate abstract type ' + new.target.name);
|
||||
|
||||
super(client);
|
||||
|
||||
if (this.constructor === NMConnectionDevice)
|
||||
throw new TypeError(`Cannot instantiate abstract type ${this.constructor.name}`);
|
||||
|
||||
this._device = device;
|
||||
this._description = '';
|
||||
|
||||
|
@@ -33,8 +33,8 @@ function primaryModifier(mask) {
|
||||
var SwitcherPopup = GObject.registerClass(
|
||||
class SwitcherPopup extends St.Widget {
|
||||
_init(items) {
|
||||
if (new.target === SwitcherPopup)
|
||||
throw new TypeError('Cannot instantiate abstract class ' + new.target.name);
|
||||
if (this.constructor.name === SwitcherPopup.prototype.constructor.name)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
|
||||
super._init({ style_class: 'switcher-popup',
|
||||
reactive: true,
|
||||
|
@@ -1870,17 +1870,25 @@ var WindowManager = class {
|
||||
}
|
||||
}
|
||||
|
||||
_getPositionForDirection(direction) {
|
||||
_getPositionForDirection(direction, fromWs, toWs) {
|
||||
let xDest = 0, yDest = 0;
|
||||
|
||||
let oldWsIsFullscreen = fromWs.list_windows().some(w => w.is_fullscreen());
|
||||
let newWsIsFullscreen = toWs.list_windows().some(w => w.is_fullscreen());
|
||||
|
||||
// We have to shift windows up or down by the height of the panel to prevent having a
|
||||
// visible gap between the windows while switching workspaces. Since fullscreen windows
|
||||
// hide the panel, they don't need to be shifted up or down.
|
||||
let shiftHeight = Main.panel.height;
|
||||
|
||||
if (direction == Meta.MotionDirection.UP ||
|
||||
direction == Meta.MotionDirection.UP_LEFT ||
|
||||
direction == Meta.MotionDirection.UP_RIGHT)
|
||||
yDest = -global.screen_height + Main.panel.height;
|
||||
yDest = -global.screen_height + (oldWsIsFullscreen ? 0 : shiftHeight);
|
||||
else if (direction == Meta.MotionDirection.DOWN ||
|
||||
direction == Meta.MotionDirection.DOWN_LEFT ||
|
||||
direction == Meta.MotionDirection.DOWN_RIGHT)
|
||||
yDest = global.screen_height - Main.panel.height;
|
||||
yDest = global.screen_height - (newWsIsFullscreen ? 0 : shiftHeight);
|
||||
|
||||
if (direction == Meta.MotionDirection.LEFT ||
|
||||
direction == Meta.MotionDirection.UP_LEFT ||
|
||||
@@ -1938,7 +1946,7 @@ var WindowManager = class {
|
||||
switchData.container.add_actor(info.actor);
|
||||
info.actor.raise_top();
|
||||
|
||||
let [x, y] = this._getPositionForDirection(dir);
|
||||
let [x, y] = this._getPositionForDirection(dir, curWs, ws);
|
||||
info.actor.set_position(x, y);
|
||||
}
|
||||
|
||||
@@ -2024,7 +2032,11 @@ var WindowManager = class {
|
||||
|
||||
this._switchData.inProgress = true;
|
||||
|
||||
let [xDest, yDest] = this._getPositionForDirection(direction);
|
||||
let workspaceManager = global.workspace_manager;
|
||||
let fromWs = workspaceManager.get_workspace_by_index(from);
|
||||
let toWs = workspaceManager.get_workspace_by_index(to);
|
||||
|
||||
let [xDest, yDest] = this._getPositionForDirection(direction, fromWs, toWs);
|
||||
|
||||
/* @direction is the direction that the "camera" moves, so the
|
||||
* screen contents have to move one screen's worth in the
|
||||
|
@@ -786,8 +786,8 @@ var WindowPositionFlags = {
|
||||
|
||||
var LayoutStrategy = class {
|
||||
constructor(monitor, rowSpacing, columnSpacing) {
|
||||
if (new.target === LayoutStrategy)
|
||||
throw new TypeError('Cannot instantiate abstract type ' + new.target.name);
|
||||
if (this.constructor === LayoutStrategy)
|
||||
throw new TypeError(`Cannot instantiate abstract type ${this.constructor.name}`);
|
||||
|
||||
this._monitor = monitor;
|
||||
this._rowSpacing = rowSpacing;
|
||||
|
68
po/eo.po
68
po/eo.po
@@ -6,22 +6,22 @@
|
||||
# Daniel PUENTES <blatberk@openmailbox.org>, 2015.
|
||||
# Nicolas MAIA < >, 2015.
|
||||
# Kristjan SCHMIDT <kristjan.schmidt@googlemail.com>, 2011, 2012, 2015, 2016, 2018.
|
||||
# Carmen Bianca BAKKER <carmen@carmenbianca.eu>, 2018, 2019.
|
||||
# Carmen Bianca BAKKER <carmen@carmenbianca.eu>, 2018-2019.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell master\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell/issues\n"
|
||||
"POT-Creation-Date: 2019-03-24 17:37+0000\n"
|
||||
"PO-Revision-Date: 2019-03-31 00:14+0100\n"
|
||||
"Last-Translator: Carmen Bianca Bakker <carmen@carmenbianca.eu>\n"
|
||||
"POT-Creation-Date: 2019-04-17 19:29+0000\n"
|
||||
"PO-Revision-Date: 2019-05-01 16:29+0200\n"
|
||||
"Last-Translator: Carmen Bianca BAKKER <carmen@carmenbianca.eu>\n"
|
||||
"Language-Team: Esperanto <gnome-eo-list@gnome.org>\n"
|
||||
"Language: eo\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 2.2.1\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
"X-Generator: Gtranslator 3.32.0\n"
|
||||
"X-DamnedLies-Scope: partial\n"
|
||||
"X-Project-Style: gnome\n"
|
||||
|
||||
@@ -681,32 +681,38 @@ msgstr "Oftaj"
|
||||
msgid "All"
|
||||
msgstr "Ĉiuj"
|
||||
|
||||
#: js/ui/appDisplay.js:1737 js/ui/panel.js:83
|
||||
#. Translators: This is the heading of a list of open windows
|
||||
#: js/ui/appDisplay.js:1713 js/ui/panel.js:79
|
||||
#| msgid "Windows"
|
||||
msgid "Open Windows"
|
||||
msgstr "Malfermaj fenestroj"
|
||||
|
||||
#: js/ui/appDisplay.js:1732 js/ui/panel.js:86
|
||||
msgid "New Window"
|
||||
msgstr "Nova fenestro"
|
||||
|
||||
#: js/ui/appDisplay.js:1751
|
||||
#: js/ui/appDisplay.js:1746
|
||||
msgid "Launch using Dedicated Graphics Card"
|
||||
msgstr "Lanĉi uzante dediĉitan vidkarton"
|
||||
|
||||
#: js/ui/appDisplay.js:1778 js/ui/dash.js:239
|
||||
#: js/ui/appDisplay.js:1773 js/ui/dash.js:239
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Forigi el preferataj"
|
||||
|
||||
#: js/ui/appDisplay.js:1784
|
||||
#: js/ui/appDisplay.js:1779
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Aldoni al preferataj"
|
||||
|
||||
#: js/ui/appDisplay.js:1794 js/ui/panel.js:94
|
||||
#: js/ui/appDisplay.js:1789 js/ui/panel.js:97
|
||||
msgid "Show Details"
|
||||
msgstr "Montri detalojn"
|
||||
|
||||
#: js/ui/appFavorites.js:141
|
||||
#: js/ui/appFavorites.js:149
|
||||
#, javascript-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s estas aldonita de via preferataj aplikaĵoj."
|
||||
|
||||
#: js/ui/appFavorites.js:175
|
||||
#: js/ui/appFavorites.js:183
|
||||
#, javascript-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s estas forigita de via preferataj aplikaĵoj."
|
||||
@@ -1060,23 +1066,23 @@ msgstr "Aldoni mondajn horloĝojn…"
|
||||
msgid "World Clocks"
|
||||
msgstr "Mondaj horloĝoj"
|
||||
|
||||
#: js/ui/dateMenu.js:222
|
||||
#: js/ui/dateMenu.js:228
|
||||
msgid "Weather"
|
||||
msgstr "Vetero"
|
||||
|
||||
#: js/ui/dateMenu.js:305
|
||||
#: js/ui/dateMenu.js:311
|
||||
msgid "Select a location…"
|
||||
msgstr "Elekti lokon…"
|
||||
|
||||
#: js/ui/dateMenu.js:313
|
||||
#: js/ui/dateMenu.js:319
|
||||
msgid "Loading…"
|
||||
msgstr "Ŝargante…"
|
||||
|
||||
#: js/ui/dateMenu.js:323
|
||||
#: js/ui/dateMenu.js:329
|
||||
msgid "Go online for weather information"
|
||||
msgstr "Enretigi por veterinformoj"
|
||||
|
||||
#: js/ui/dateMenu.js:325
|
||||
#: js/ui/dateMenu.js:331
|
||||
msgid "Weather information is currently unavailable"
|
||||
msgstr "Veterinformoj ĉimomente nehaveblas"
|
||||
|
||||
@@ -1452,34 +1458,25 @@ msgstr "Premu Esk-klavon por ĉesi"
|
||||
msgid "Press any key to exit"
|
||||
msgstr "Premu iun ajn klavon por ĉesi"
|
||||
|
||||
#: js/ui/panel.js:108
|
||||
#: js/ui/panel.js:113
|
||||
msgid "Quit"
|
||||
msgstr "Ĉesi"
|
||||
|
||||
#. Translators: If there is no suitable word for "Activities"
|
||||
#. in your language, you can use the word for "Overview".
|
||||
#: js/ui/panel.js:471
|
||||
#: js/ui/panel.js:468
|
||||
msgid "Activities"
|
||||
msgstr "Aktivecoj"
|
||||
|
||||
#: js/ui/panel.js:746
|
||||
#: js/ui/panel.js:743
|
||||
msgctxt "System menu in the top bar"
|
||||
msgid "System"
|
||||
msgstr "Sistemo"
|
||||
|
||||
#: js/ui/panel.js:867
|
||||
#: js/ui/panel.js:864
|
||||
msgid "Top Bar"
|
||||
msgstr "Supra breto"
|
||||
|
||||
#. Translators: this MUST be either "toggle-switch-us"
|
||||
#. (for toggle switches containing the English words
|
||||
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle
|
||||
#. switches containing "◯" and "|"). Other values will
|
||||
#. simply result in invisible toggle switches.
|
||||
#: js/ui/popupMenu.js:285
|
||||
msgid "toggle-switch-us"
|
||||
msgstr "toggle-switch-intl"
|
||||
|
||||
#: js/ui/runDialog.js:64
|
||||
msgid "Enter a Command"
|
||||
msgstr "Enigu komandon"
|
||||
@@ -1889,11 +1886,11 @@ msgid_plural "%s Modem Connections"
|
||||
msgstr[0] "%s modema konekto"
|
||||
msgstr[1] "%s modemaj konektoj"
|
||||
|
||||
#: js/ui/status/network.js:1701
|
||||
#: js/ui/status/network.js:1705
|
||||
msgid "Connection failed"
|
||||
msgstr "Konekto malsukcesis"
|
||||
|
||||
#: js/ui/status/network.js:1702
|
||||
#: js/ui/status/network.js:1706
|
||||
msgid "Activation of network connection failed"
|
||||
msgstr "Aktivigo de reto-konekto malsukcesis"
|
||||
|
||||
@@ -2098,7 +2095,7 @@ msgstr[1] "Agordaj ŝanĝoj malfaritos post %d sekundoj"
|
||||
|
||||
#. Translators: This represents the size of a window. The first number is
|
||||
#. * the width of the window and the second is the height.
|
||||
#: js/ui/windowManager.js:662
|
||||
#: js/ui/windowManager.js:677
|
||||
#, javascript-format
|
||||
msgid "%d × %d"
|
||||
msgstr "%d × %d"
|
||||
@@ -2231,6 +2228,9 @@ msgstr[1] "%u enigoj"
|
||||
msgid "System Sounds"
|
||||
msgstr "Sistemsonoj"
|
||||
|
||||
#~ msgid "toggle-switch-us"
|
||||
#~ msgstr "toggle-switch-intl"
|
||||
|
||||
#~ msgid "network-workgroup"
|
||||
#~ msgstr "network-workgroup"
|
||||
|
||||
|
@@ -863,6 +863,7 @@ _shell_global_set_plugin (ShellGlobal *global,
|
||||
}
|
||||
|
||||
st_entry_set_cursor_func (entry_cursor_func, global);
|
||||
st_clipboard_set_selection (meta_display_get_selection (display));
|
||||
|
||||
g_signal_connect (global->stage, "notify::width",
|
||||
G_CALLBACK (global_stage_notify_width), global);
|
||||
|
@@ -125,7 +125,7 @@ st_cflags = [
|
||||
libst = shared_library('st-1.0',
|
||||
sources: st_gir_sources + st_non_gir_sources,
|
||||
c_args: st_cflags,
|
||||
dependencies: [clutter_dep, gtk_dep, croco_dep, x11_dep, m_dep],
|
||||
dependencies: [clutter_dep, gtk_dep, croco_dep, mutter_dep, m_dep],
|
||||
build_rpath: mutter_typelibdir,
|
||||
install_rpath: mutter_typelibdir,
|
||||
install_dir: pkglibdir,
|
||||
@@ -152,7 +152,7 @@ libst_gir = gnome.generate_gir(libst,
|
||||
sources: st_gir_sources,
|
||||
nsversion: '1.0',
|
||||
namespace: 'St',
|
||||
includes: ['Clutter-' + mutter_api_version, 'Cally-' + mutter_api_version, 'Gtk-3.0'],
|
||||
includes: ['Clutter-' + mutter_api_version, 'Cally-' + mutter_api_version, 'Meta-' + mutter_api_version, 'Gtk-3.0'],
|
||||
dependencies: [mutter_dep],
|
||||
include_directories: include_directories('..'),
|
||||
extra_args: ['-DST_COMPILATION', '--quiet'],
|
||||
|
@@ -19,251 +19,49 @@
|
||||
|
||||
/**
|
||||
* SECTION:st-clipboard
|
||||
* @short_description: a simple representation of the X clipboard
|
||||
* @short_description: a simple representation of the clipboard
|
||||
*
|
||||
* #StCliboard is a very simple object representation of the clipboard
|
||||
* available to applications. Text is always assumed to be UTF-8 and non-text
|
||||
* items are not handled.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "st-clipboard.h"
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <string.h>
|
||||
|
||||
struct _StClipboardPrivate
|
||||
{
|
||||
Window clipboard_window;
|
||||
gchar *clipboard_text;
|
||||
#include <meta/display.h>
|
||||
#include <meta/meta-selection-source-memory.h>
|
||||
#include <meta/meta-selection.h>
|
||||
|
||||
Atom *supported_targets;
|
||||
gint n_targets;
|
||||
};
|
||||
G_DEFINE_TYPE (StClipboard, st_clipboard, G_TYPE_OBJECT)
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (StClipboard, st_clipboard, G_TYPE_OBJECT)
|
||||
|
||||
typedef struct _EventFilterData EventFilterData;
|
||||
struct _EventFilterData
|
||||
typedef struct _TransferData TransferData;
|
||||
struct _TransferData
|
||||
{
|
||||
StClipboard *clipboard;
|
||||
StClipboardCallbackFunc callback;
|
||||
gpointer user_data;
|
||||
GOutputStream *stream;
|
||||
};
|
||||
|
||||
static Atom __atom_primary = None;
|
||||
static Atom __atom_clip = None;
|
||||
static Atom __utf8_string = None;
|
||||
static Atom __atom_targets = None;
|
||||
|
||||
static void
|
||||
st_clipboard_dispose (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (st_clipboard_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
st_clipboard_finalize (GObject *object)
|
||||
{
|
||||
StClipboardPrivate *priv = ((StClipboard *) object)->priv;
|
||||
|
||||
g_free (priv->clipboard_text);
|
||||
priv->clipboard_text = NULL;
|
||||
|
||||
g_free (priv->supported_targets);
|
||||
priv->supported_targets = NULL;
|
||||
priv->n_targets = 0;
|
||||
|
||||
G_OBJECT_CLASS (st_clipboard_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
st_clipboard_provider (GdkXEvent *xevent_p,
|
||||
GdkEvent *gev,
|
||||
void *user_data)
|
||||
{
|
||||
StClipboard *clipboard = user_data;
|
||||
XEvent *xev = (XEvent *) xevent_p;
|
||||
XSelectionEvent notify_event;
|
||||
XSelectionRequestEvent *req_event;
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
|
||||
if (xev->type != SelectionRequest ||
|
||||
xev->xany.window != clipboard->priv->clipboard_window ||
|
||||
!clipboard->priv->clipboard_text)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
|
||||
req_event = &xev->xselectionrequest;
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
if (req_event->target == __atom_targets)
|
||||
{
|
||||
XChangeProperty (req_event->display,
|
||||
req_event->requestor,
|
||||
req_event->property,
|
||||
XA_ATOM,
|
||||
32,
|
||||
PropModeReplace,
|
||||
(guchar*) clipboard->priv->supported_targets,
|
||||
clipboard->priv->n_targets);
|
||||
}
|
||||
else
|
||||
{
|
||||
XChangeProperty (req_event->display,
|
||||
req_event->requestor,
|
||||
req_event->property,
|
||||
req_event->target,
|
||||
8,
|
||||
PropModeReplace,
|
||||
(guchar*) clipboard->priv->clipboard_text,
|
||||
strlen (clipboard->priv->clipboard_text));
|
||||
}
|
||||
|
||||
notify_event.type = SelectionNotify;
|
||||
notify_event.display = req_event->display;
|
||||
notify_event.requestor = req_event->requestor;
|
||||
notify_event.selection = req_event->selection;
|
||||
notify_event.target = req_event->target;
|
||||
notify_event.time = req_event->time;
|
||||
|
||||
if (req_event->property == None)
|
||||
notify_event.property = req_event->target;
|
||||
else
|
||||
notify_event.property = req_event->property;
|
||||
|
||||
/* notify the requestor that they have a copy of the selection */
|
||||
XSendEvent (req_event->display, req_event->requestor, False, 0,
|
||||
(XEvent *) ¬ify_event);
|
||||
/* Make it happen non async */
|
||||
XSync (GDK_DISPLAY_XDISPLAY (display), FALSE);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
{
|
||||
/* FIXME: Warn here on fail ? */
|
||||
}
|
||||
|
||||
return GDK_FILTER_REMOVE;
|
||||
}
|
||||
const char *supported_mimetypes[] = {
|
||||
"text/plain;charset=utf-8",
|
||||
"UTF8_STRING",
|
||||
"text/plain",
|
||||
"STRING",
|
||||
};
|
||||
|
||||
static MetaSelection *meta_selection = NULL;
|
||||
|
||||
static void
|
||||
st_clipboard_class_init (StClipboardClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = st_clipboard_dispose;
|
||||
object_class->finalize = st_clipboard_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
st_clipboard_init (StClipboard *self)
|
||||
{
|
||||
GdkDisplay *gdk_display;
|
||||
Display *dpy;
|
||||
StClipboardPrivate *priv;
|
||||
|
||||
priv = self->priv = st_clipboard_get_instance_private (self);
|
||||
|
||||
gdk_display = gdk_display_get_default ();
|
||||
dpy = GDK_DISPLAY_XDISPLAY (gdk_display);
|
||||
|
||||
priv->clipboard_window =
|
||||
XCreateSimpleWindow (dpy,
|
||||
gdk_x11_get_default_root_xwindow (),
|
||||
-1, -1, 1, 1, 0, 0, 0);
|
||||
|
||||
/* Only create once */
|
||||
if (__atom_primary == None)
|
||||
__atom_primary = XInternAtom (dpy, "PRIMARY", 0);
|
||||
|
||||
if (__atom_clip == None)
|
||||
__atom_clip = XInternAtom (dpy, "CLIPBOARD", 0);
|
||||
|
||||
if (__utf8_string == None)
|
||||
__utf8_string = XInternAtom (dpy, "UTF8_STRING", 0);
|
||||
|
||||
if (__atom_targets == None)
|
||||
__atom_targets = XInternAtom (dpy, "TARGETS", 0);
|
||||
|
||||
priv->n_targets = 2;
|
||||
priv->supported_targets = g_new (Atom, priv->n_targets);
|
||||
|
||||
priv->supported_targets[0] = __utf8_string;
|
||||
priv->supported_targets[1] = __atom_targets;
|
||||
|
||||
gdk_window_add_filter (NULL, /* all windows */
|
||||
st_clipboard_provider,
|
||||
self);
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
st_clipboard_x11_event_filter (GdkXEvent *xevent_p,
|
||||
GdkEvent *gev,
|
||||
void *user_data)
|
||||
{
|
||||
XEvent *xev = (XEvent *) xevent_p;
|
||||
EventFilterData *filter_data = user_data;
|
||||
StClipboardPrivate *priv = filter_data->clipboard->priv;
|
||||
Atom actual_type;
|
||||
int actual_format, result;
|
||||
unsigned long nitems, bytes_after;
|
||||
unsigned char *data = NULL;
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
|
||||
if(xev->type != SelectionNotify ||
|
||||
xev->xany.window != priv->clipboard_window)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
|
||||
if (xev->xselection.property == None)
|
||||
{
|
||||
/* clipboard empty */
|
||||
filter_data->callback (filter_data->clipboard,
|
||||
NULL,
|
||||
filter_data->user_data);
|
||||
|
||||
gdk_window_remove_filter (NULL,
|
||||
st_clipboard_x11_event_filter,
|
||||
filter_data);
|
||||
g_free (filter_data);
|
||||
return GDK_FILTER_REMOVE;
|
||||
}
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
result = XGetWindowProperty (xev->xselection.display,
|
||||
xev->xselection.requestor,
|
||||
xev->xselection.property,
|
||||
0L, G_MAXINT,
|
||||
True,
|
||||
AnyPropertyType,
|
||||
&actual_type,
|
||||
&actual_format,
|
||||
&nitems,
|
||||
&bytes_after,
|
||||
&data);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (display) || result != Success)
|
||||
{
|
||||
/* FIXME: handle failure better */
|
||||
g_warning ("Clipboard: prop retrival failed");
|
||||
}
|
||||
|
||||
filter_data->callback (filter_data->clipboard, (char*) data,
|
||||
filter_data->user_data);
|
||||
|
||||
gdk_window_remove_filter (NULL,
|
||||
st_clipboard_x11_event_filter,
|
||||
filter_data);
|
||||
|
||||
g_free (filter_data);
|
||||
|
||||
if (data)
|
||||
XFree (data);
|
||||
|
||||
return GDK_FILTER_REMOVE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -287,10 +85,57 @@ st_clipboard_get_default (void)
|
||||
return default_clipboard;
|
||||
}
|
||||
|
||||
static Atom
|
||||
atom_for_clipboard_type (StClipboardType type)
|
||||
static gboolean
|
||||
convert_type (StClipboardType type,
|
||||
MetaSelectionType *type_out)
|
||||
{
|
||||
return type == ST_CLIPBOARD_TYPE_CLIPBOARD ? __atom_clip : __atom_primary;
|
||||
if (type == ST_CLIPBOARD_TYPE_PRIMARY)
|
||||
*type_out = META_SELECTION_PRIMARY;
|
||||
else if (type == ST_CLIPBOARD_TYPE_CLIPBOARD)
|
||||
*type_out = META_SELECTION_CLIPBOARD;
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const char *
|
||||
pick_mimetype (MetaSelection *meta_selection,
|
||||
MetaSelectionType selection_type)
|
||||
{
|
||||
const char *selected_mimetype = NULL;
|
||||
GList *mimetypes;
|
||||
int i;
|
||||
|
||||
mimetypes = meta_selection_get_mimetypes (meta_selection, selection_type);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (supported_mimetypes); i++)
|
||||
{
|
||||
if (g_list_find_custom (mimetypes, supported_mimetypes[i],
|
||||
(GCompareFunc) g_strcmp0))
|
||||
{
|
||||
selected_mimetype = supported_mimetypes[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free_full (mimetypes, g_free);
|
||||
return selected_mimetype;
|
||||
}
|
||||
|
||||
static void
|
||||
transfer_cb (MetaSelection *selection,
|
||||
GAsyncResult *res,
|
||||
TransferData *data)
|
||||
{
|
||||
const gchar *text = NULL;
|
||||
|
||||
if (meta_selection_transfer_finish (selection, res, NULL))
|
||||
text = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (data->stream));
|
||||
|
||||
data->callback (data->clipboard, text, data->user_data);
|
||||
g_object_unref (data->stream);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,37 +155,35 @@ st_clipboard_get_text (StClipboard *clipboard,
|
||||
StClipboardCallbackFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
EventFilterData *data;
|
||||
GdkDisplay *gdk_display;
|
||||
Display *dpy;
|
||||
MetaSelectionType selection_type;
|
||||
TransferData *data;
|
||||
const char *mimetype = NULL;
|
||||
|
||||
g_return_if_fail (ST_IS_CLIPBOARD (clipboard));
|
||||
g_return_if_fail (meta_selection != NULL);
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
data = g_new0 (EventFilterData, 1);
|
||||
if (convert_type (type, &selection_type))
|
||||
mimetype = pick_mimetype (meta_selection, selection_type);
|
||||
|
||||
if (!mimetype)
|
||||
{
|
||||
callback (clipboard, NULL, user_data);
|
||||
return;
|
||||
}
|
||||
|
||||
data = g_new0 (TransferData, 1);
|
||||
data->clipboard = clipboard;
|
||||
data->callback = callback;
|
||||
data->user_data = user_data;
|
||||
data->stream = g_memory_output_stream_new_resizable ();
|
||||
|
||||
gdk_window_add_filter (NULL, /* all windows */
|
||||
st_clipboard_x11_event_filter,
|
||||
data);
|
||||
|
||||
gdk_display = gdk_display_get_default ();
|
||||
dpy = GDK_DISPLAY_XDISPLAY (gdk_display);
|
||||
|
||||
gdk_x11_display_error_trap_push (gdk_display);
|
||||
|
||||
XConvertSelection (dpy,
|
||||
atom_for_clipboard_type (type),
|
||||
__utf8_string, __utf8_string,
|
||||
clipboard->priv->clipboard_window,
|
||||
CurrentTime);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (gdk_display))
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
meta_selection_transfer_async (meta_selection,
|
||||
selection_type,
|
||||
mimetype, -1,
|
||||
data->stream, NULL,
|
||||
(GAsyncReadyCallback) transfer_cb,
|
||||
data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -356,31 +199,26 @@ st_clipboard_set_text (StClipboard *clipboard,
|
||||
StClipboardType type,
|
||||
const gchar *text)
|
||||
{
|
||||
StClipboardPrivate *priv;
|
||||
GdkDisplay *gdk_display;
|
||||
Display *dpy;
|
||||
MetaSelectionType selection_type;
|
||||
MetaSelectionSource *source;
|
||||
GBytes *bytes;
|
||||
|
||||
g_return_if_fail (ST_IS_CLIPBOARD (clipboard));
|
||||
g_return_if_fail (meta_selection != NULL);
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
priv = clipboard->priv;
|
||||
if (!convert_type (type, &selection_type))
|
||||
return;
|
||||
|
||||
/* make a copy of the text */
|
||||
g_free (priv->clipboard_text);
|
||||
priv->clipboard_text = g_strdup (text);
|
||||
bytes = g_bytes_new_take (g_strdup (text), strlen (text));
|
||||
source = meta_selection_source_memory_new ("text/plain;charset=utf-8", bytes);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
/* tell X we own the clipboard selection */
|
||||
gdk_display = gdk_display_get_default ();
|
||||
dpy = GDK_DISPLAY_XDISPLAY (gdk_display);
|
||||
|
||||
gdk_x11_display_error_trap_push (gdk_display);
|
||||
|
||||
XSetSelectionOwner (dpy, atom_for_clipboard_type (type), priv->clipboard_window, CurrentTime);
|
||||
|
||||
XSync (dpy, FALSE);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (gdk_display))
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
meta_selection_set_owner (meta_selection, selection_type, source);
|
||||
}
|
||||
|
||||
void
|
||||
st_clipboard_set_selection (MetaSelection *selection)
|
||||
{
|
||||
meta_selection = selection;
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#define _ST_CLIPBOARD_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <meta/meta-selection.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -32,7 +33,6 @@ G_BEGIN_DECLS
|
||||
G_DECLARE_FINAL_TYPE (StClipboard, st_clipboard, ST, CLIPBOARD, GObject)
|
||||
|
||||
typedef struct _StClipboard StClipboard;
|
||||
typedef struct _StClipboardPrivate StClipboardPrivate;
|
||||
|
||||
/**
|
||||
* StClipboard:
|
||||
@@ -44,7 +44,6 @@ struct _StClipboard
|
||||
{
|
||||
/*< private >*/
|
||||
GObject parent;
|
||||
StClipboardPrivate *priv;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
@@ -74,6 +73,8 @@ void st_clipboard_set_text (StClipboard *clipboard,
|
||||
StClipboardType type,
|
||||
const gchar *text);
|
||||
|
||||
void st_clipboard_set_selection (MetaSelection *selection);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _ST_CLIPBOARD_H */
|
||||
|
@@ -206,8 +206,8 @@ st_icon_style_changed (StWidget *widget)
|
||||
}
|
||||
|
||||
priv->theme_icon_size = (int)(0.5 + st_theme_node_get_length (theme_node, "icon-size"));
|
||||
st_icon_update_icon_size (self);
|
||||
st_icon_update (self);
|
||||
if (st_icon_update_icon_size (self))
|
||||
st_icon_update (self);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -496,15 +496,31 @@ pixbuf_to_st_content_image (GdkPixbuf *pixbuf,
|
||||
ClutterContent *image;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (width < 0)
|
||||
width = ceilf (gdk_pixbuf_get_width (pixbuf) / resource_scale);
|
||||
else
|
||||
width *= paint_scale;
|
||||
float native_width, native_height;
|
||||
|
||||
if (height < 0)
|
||||
height = ceilf (gdk_pixbuf_get_height (pixbuf) / resource_scale);
|
||||
native_width = ceilf (gdk_pixbuf_get_width (pixbuf) / resource_scale);
|
||||
native_height = ceilf (gdk_pixbuf_get_height (pixbuf) / resource_scale);
|
||||
|
||||
if (width < 0 && height < 0)
|
||||
{
|
||||
width = native_width;
|
||||
height = native_height;
|
||||
}
|
||||
else if (width < 0)
|
||||
{
|
||||
height *= paint_scale;
|
||||
width = native_width * (height / native_height);
|
||||
}
|
||||
else if (height < 0)
|
||||
{
|
||||
width *= paint_scale;
|
||||
height = native_height * (width / native_width);
|
||||
}
|
||||
else
|
||||
height *= paint_scale;
|
||||
{
|
||||
width *= paint_scale;
|
||||
height *= paint_scale;
|
||||
}
|
||||
|
||||
image = st_image_content_new_with_preferred_size (width, height);
|
||||
clutter_image_set_data (CLUTTER_IMAGE (image),
|
||||
|
@@ -107,6 +107,8 @@ struct _StThemeNode {
|
||||
int box_shadow_min_width;
|
||||
int box_shadow_min_height;
|
||||
|
||||
guint stylesheets_changed_id;
|
||||
|
||||
CoglPipeline *border_slices_texture;
|
||||
CoglPipeline *border_slices_pipeline;
|
||||
CoglPipeline *background_texture;
|
||||
|
@@ -111,9 +111,11 @@ st_theme_node_dispose (GObject *gobject)
|
||||
node->icon_colors = NULL;
|
||||
}
|
||||
|
||||
if (node->theme)
|
||||
g_signal_handlers_disconnect_by_func (node->theme,
|
||||
on_custom_stylesheets_changed, node);
|
||||
if (node->theme && node->stylesheets_changed_id)
|
||||
{
|
||||
g_signal_handler_disconnect (node->theme, node->stylesheets_changed_id);
|
||||
node->stylesheets_changed_id = 0;
|
||||
}
|
||||
|
||||
st_theme_node_paint_state_free (&node->cached_state);
|
||||
|
||||
@@ -230,8 +232,9 @@ st_theme_node_new (StThemeContext *context,
|
||||
if (theme != NULL)
|
||||
{
|
||||
node->theme = g_object_ref (theme);
|
||||
g_signal_connect (node->theme, "custom-stylesheets-changed",
|
||||
G_CALLBACK (on_custom_stylesheets_changed), node);
|
||||
node->stylesheets_changed_id =
|
||||
g_signal_connect (node->theme, "custom-stylesheets-changed",
|
||||
G_CALLBACK (on_custom_stylesheets_changed), node);
|
||||
}
|
||||
|
||||
node->element_type = element_type;
|
||||
|
Reference in New Issue
Block a user