Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/ui/expoThumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ var ExpoWindowClone = GObject.registerClass({
let clone = clones[i].actor;
this.clone.add_actor(clone);
let [width, height] = clone.get_size();
clone.set_position(Math.round((pwidth - width) / 2), Math.round((pheight - height) / 2));
clone.set_position((pwidth - width) / 2, (pheight - height) / 2);
}
}

Expand Down
4 changes: 2 additions & 2 deletions js/ui/ibusCandidatePopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
}

_setDummyCursorGeometry(x, y, w, h) {
this._dummyCursor.set_position(Math.round(x), Math.round(y));
this._dummyCursor.set_size(Math.round(w), Math.round(h));
this._dummyCursor.set_position(x, y);
this._dummyCursor.set_size(w, h);

if (this.visible)
this.setPosition(this._dummyCursor, 0);
Expand Down
8 changes: 4 additions & 4 deletions js/ui/magnifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -1223,13 +1223,13 @@ var ZoomRegion = class ZoomRegion {
_setViewPort(viewPort, fromROIUpdate) {
// Sets the position of the zoom region on the screen

let width = Math.round(Math.min(viewPort.width, global.screen_width));
let height = Math.round(Math.min(viewPort.height, global.screen_height));
let width = Math.min(viewPort.width, global.screen_width);
let height = Math.min(viewPort.height, global.screen_height);
let x = Math.max(viewPort.x, 0);
let y = Math.max(viewPort.y, 0);

x = Math.round(Math.min(x, global.screen_width - width));
y = Math.round(Math.min(y, global.screen_height - height));
x = Math.min(x, global.screen_width - width);
y = Math.min(y, global.screen_height - height);

this._viewPortX = x;
this._viewPortY = y;
Expand Down
4 changes: 2 additions & 2 deletions js/ui/modalDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ var InfoOSD = class {
this.actor.opacity = 0;
this.actor.show();

let x = monitor.x + Math.round((monitor.width - this.actor.width)/2);
let y = monitor.y + Math.round((monitor.height - this.actor.height)/2);
let x = monitor.x + (monitor.width - this.actor.width) / 2;
let y = monitor.y + (monitor.height - this.actor.height) / 2;

this.actor.set_position(x, y);
this.actor.opacity = 255;
Expand Down
4 changes: 2 additions & 2 deletions js/ui/popupDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class PopupDialog extends BaseDialog.BaseDialog {
this.opacity = 0;
this.show();

let x = monitor.x + Math.round((monitor.width - this.width) / 2);
let y = monitor.y + Math.round((monitor.height - this.height) / 2);
let x = monitor.x + (monitor.width - this.width) / 2;
let y = monitor.y + (monitor.height - this.height) / 2;
this.set_position(x, y);
}

Expand Down
4 changes: 2 additions & 2 deletions js/ui/popupMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ var PopupMenu = class PopupMenu extends PopupMenuBase {
}
break;
}
return [Math.round(xPos), Math.round(yPos)];
return [xPos, yPos];
}

_boxGetPreferredWidth (actor, forHeight, alloc) {
Expand Down Expand Up @@ -2513,7 +2513,7 @@ var PopupComboMenu = class PopupComboMenu extends PopupMenuBase {
let activeItem = this._getMenuItems()[this._activeItemPos];

let [sourceX, sourceY] = this.sourceActor.get_transformed_position();
this.actor.set_position(Math.round(sourceX), Math.round(sourceY - activeItem.actor.y));
this.actor.set_position(sourceX, sourceY - activeItem.actor.y);

this.actor.raise_top();

Expand Down
6 changes: 3 additions & 3 deletions js/ui/screensaver/screenShield.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ var ScreenShield = GObject.registerClass({
let x = monitor.x + (monitor.width - natWidth) / 2;
let y = monitor.y + monitor.height - natHeight - padding;

this._keyboardBox.set_position(Math.floor(x), Math.floor(y));
this._keyboardBox.set_position(x, y);
this._keyboardBox.set_size(natWidth, natHeight);
}
}
Expand Down Expand Up @@ -901,7 +901,7 @@ var ScreenShield = GObject.registerClass({
let x = sectorLeft + (sectorWidth - widgetWidth) / 2;
let y = sectorTop + (sectorHeight - widgetHeight) / 2;

widget.set_position(Math.floor(x), Math.floor(y));
widget.set_position(x, y);
widget._isBeingPositioned = false;
}

Expand Down Expand Up @@ -1085,7 +1085,7 @@ var ScreenShield = GObject.registerClass({
let x = monitor.x + monitor.width - natWidth - padding;
let y = monitor.y + padding;

this._infoPanel.set_position(Math.floor(x), Math.floor(y));
this._infoPanel.set_position(x, y);
}

_positionWidgetByState(widget) {
Expand Down
8 changes: 4 additions & 4 deletions js/ui/tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,21 +357,21 @@ PanelItemTooltip.prototype = {
case St.Side.BOTTOM:
panel = Main.panelManager.getPanel(monitor.index, PanelLoc.bottom);
tooltipTop = monitor.y + monitor.height - tooltipHeight - panel.get_height();
tooltipLeft = this.mousePosition[0] - Math.round(tooltipWidth / 2);
tooltipLeft = this.mousePosition[0] - tooltipWidth / 2;
tooltipLeft = Math.max(tooltipLeft, monitor.x);
tooltipLeft = Math.min(tooltipLeft, monitor.x + monitor.width - tooltipWidth);
break;
case St.Side.TOP:
panel = Main.panelManager.getPanel(monitor.index, PanelLoc.top);
tooltipTop = monitor.y + panel.get_height();
tooltipLeft = this.mousePosition[0] - Math.round(tooltipWidth / 2);
tooltipLeft = this.mousePosition[0] - tooltipWidth / 2;
tooltipLeft = Math.max(tooltipLeft, monitor.x);
tooltipLeft = Math.min(tooltipLeft, monitor.x + monitor.width - tooltipWidth);
break;
case St.Side.LEFT:
panel = Main.panelManager.getPanel(monitor.index, PanelLoc.left);
tooltipTop = this._panelItem.actor.get_transformed_position()[1];
tooltipTop += Math.round((this._panelItem.actor.height - tooltipHeight) / 2);
tooltipTop += (this._panelItem.actor.height - tooltipHeight) / 2;

// Fix for the tooltip clipping outside the screen when it's very close to the top or bottom.
if (tooltipTop < monitor.y) {
Expand All @@ -386,7 +386,7 @@ PanelItemTooltip.prototype = {
case St.Side.RIGHT:
panel = Main.panelManager.getPanel(monitor.index, PanelLoc.right);
tooltipTop = this._panelItem.actor.get_transformed_position()[1];
tooltipTop += Math.round((this._panelItem.actor.height - tooltipHeight) / 2);
tooltipTop += (this._panelItem.actor.height - tooltipHeight) / 2;

// Fix for the tooltip clipping outside the screen when it's very close to the top or bottom.
if (tooltipTop < monitor.y) {
Expand Down
16 changes: 8 additions & 8 deletions js/ui/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,20 +395,20 @@ var WindowOverlay = GObject.registerClass({
button.remove_style_class_name('left');
button.add_style_class_name('right');
}
button.set_position(Math.round(buttonX), Math.round(buttonY));
button.set_position(buttonX, buttonY);

let borderX = cloneX - this.borderWidth;
let borderY = cloneY - this.borderWidth;
let borderWidth = cloneWidth + 2 * this.borderWidth;
let borderHeight = cloneHeight + 2 * this.borderWidth;
border.set_position(Math.round(borderX), Math.round(borderY));
border.set_size(Math.round(borderWidth), Math.round(borderHeight));
border.set_position(borderX, borderY);
border.set_size(borderWidth, borderHeight);

let [minW, captionWidth] = caption.get_preferred_width(-1);
captionWidth = Math.min(maxWidth, captionWidth);
let captionX = cloneX + (cloneWidth - captionWidth) / 2;
let captionY = cloneY + cloneHeight + caption._spacing;
caption.set_position(Math.round(captionX), Math.round(captionY));
caption.set_position(captionX, captionY);
caption.width = captionWidth;
}

Expand Down Expand Up @@ -664,8 +664,8 @@ class WorkspaceMonitor extends Clutter.Actor {
(height - topBorder - bottomBorder) / rect.height,
1.0);
// This is magic
x = Math.floor(x + (width - scale * rect.width - rightBorder + leftBorder) / 2);
y = Math.floor(y + (height - scale * rect.height - bottomBorder + topBorder) / 2);
x = x + (width - scale * rect.width - rightBorder + leftBorder) / 2;
y = y + (height - scale * rect.height - bottomBorder + topBorder) / 2;
return [x, y, scale];
}

Expand Down Expand Up @@ -818,8 +818,8 @@ class WorkspaceMonitor extends Clutter.Actor {
if (this._windows.length > 0) {
placeholder.hide();
} else {
let x = this._monitor.x + Math.floor((this._monitor.width - placeholder.width)/2);
let y = this._monitor.y + Math.floor((this._monitor.height - placeholder.height)/2);
let x = this._monitor.x + (this._monitor.width - placeholder.width) / 2;
let y = this._monitor.y + (this._monitor.height - placeholder.height) / 2;
placeholder.set_position(x, y);
placeholder.show();
}
Expand Down
Loading