Bump to version 68.5
This commit is contained in:
+56
-37
@@ -168,7 +168,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
})
|
||||
this._dtpIconContainer = new St.Widget({
|
||||
layout_manager: new Clutter.BinLayout(),
|
||||
style: getIconContainerStyle(panel.checkIfVertical()),
|
||||
style: getIconContainerStyle(panel.geom.vertical),
|
||||
})
|
||||
|
||||
this.remove_child(this._iconContainer)
|
||||
@@ -199,7 +199,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
this._container.add_child(this._dotsContainer)
|
||||
this.set_child(this._container)
|
||||
|
||||
if (panel.checkIfVertical()) {
|
||||
if (panel.geom.vertical) {
|
||||
this.set_width(panel.geom.innerSize)
|
||||
}
|
||||
|
||||
@@ -365,6 +365,11 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
_onDestroy() {
|
||||
super._onDestroy()
|
||||
|
||||
if (this._updateIconIdleId) {
|
||||
GLib.source_remove(this._updateIconIdleId)
|
||||
this._updateIconIdleId = 0
|
||||
}
|
||||
|
||||
this._timeoutsHandler.destroy()
|
||||
this._signalsHandler.destroy()
|
||||
|
||||
@@ -395,18 +400,25 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
// and position are random values, which might exceeds the integer range
|
||||
// resulting in an error when assigned to the a rect. This is a more like
|
||||
// a workaround to prevent flooding the system with errors.
|
||||
if (this.get_stage() == null) return
|
||||
if (this.get_stage() == null || this._updateIconIdleId) return
|
||||
|
||||
let rect = new Mtk.Rectangle()
|
||||
this._updateIconIdleId = GLib.idle_add(GLib.PRIORITY_LOW, () => {
|
||||
let rect = new Mtk.Rectangle()
|
||||
|
||||
;[rect.x, rect.y] = this.get_transformed_position()
|
||||
;[rect.width, rect.height] = this.get_transformed_size()
|
||||
;[rect.x, rect.y] = this.get_transformed_position()
|
||||
;[rect.width, rect.height] = this.get_transformed_size()
|
||||
|
||||
let windows = this.window
|
||||
? [this.window]
|
||||
: this.getAppIconInterestingWindows(true)
|
||||
windows.forEach(function (w) {
|
||||
w.set_icon_geometry(rect)
|
||||
let windows = this.window
|
||||
? [this.window]
|
||||
: this.getAppIconInterestingWindows(true)
|
||||
|
||||
windows.forEach(function (w) {
|
||||
w.set_icon_geometry(rect)
|
||||
})
|
||||
|
||||
this._updateIconIdleId = 0
|
||||
|
||||
return GLib.SOURCE_REMOVE
|
||||
})
|
||||
}
|
||||
|
||||
@@ -561,7 +573,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
SETTINGS.get_int('group-apps-label-max-width') * scaleFactor
|
||||
let variableWidth =
|
||||
!useFixedWidth ||
|
||||
this.dtpPanel.checkIfVertical() ||
|
||||
this.dtpPanel.geom.vertical ||
|
||||
this.dtpPanel.taskbar.fullScrollView
|
||||
|
||||
this._windowTitle[maxLabelWidth > 0 ? 'show' : 'hide']()
|
||||
@@ -621,7 +633,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
_setAppIconPadding() {
|
||||
const padding = getIconPadding(this.dtpPanel)
|
||||
const margin = Taskbar.APPICON_MARGIN
|
||||
let vertical = this.dtpPanel.checkIfVertical()
|
||||
let vertical = this.dtpPanel.geom.vertical
|
||||
|
||||
this.set_style(
|
||||
`padding: ${vertical ? margin : 0}px ${vertical ? 0 : margin}px;`,
|
||||
@@ -655,7 +667,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
Main.uiGroup.add_child(this._menu.actor)
|
||||
this._menuManager.addMenu(this._menu)
|
||||
}
|
||||
this._menu.updateQuitText()
|
||||
this._menu.updateQuitItems()
|
||||
|
||||
this.emit('menu-state-changed', true)
|
||||
|
||||
@@ -1599,7 +1611,6 @@ export function getInterestingWindows(app, monitor, isolateMonitors) {
|
||||
|
||||
if (
|
||||
monitor &&
|
||||
SETTINGS.get_boolean('multi-monitors') &&
|
||||
(isolateMonitors || SETTINGS.get_boolean('isolate-monitors'))
|
||||
) {
|
||||
windows = windows.filter(function (w) {
|
||||
@@ -1647,36 +1658,44 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu {
|
||||
this._enableFavorites = true
|
||||
this._showSingleWindows = true
|
||||
|
||||
if (source.window)
|
||||
this._quitAllItem = this.addAction('QuitAll', () =>
|
||||
this._quitFromTaskbar(true),
|
||||
)
|
||||
|
||||
// replace quit item
|
||||
delete this._quitItem
|
||||
this._quitItem = this.addAction(_('Quit'), () => this._quitFromTaskbar())
|
||||
}
|
||||
|
||||
updateQuitText() {
|
||||
let count = this.sourceActor.window
|
||||
? 1
|
||||
: getInterestingWindows(this._app, this.sourceActor.dtpPanel.monitor)
|
||||
.length
|
||||
updateQuitItems() {
|
||||
let ungrouped = !!this.sourceActor.window
|
||||
let quitText = _('Quit')
|
||||
let count = getInterestingWindows(
|
||||
this._app,
|
||||
this.sourceActor.dtpPanel.monitor,
|
||||
).length
|
||||
let quitMultipleText = ngettext(
|
||||
'Quit %d Window',
|
||||
'Quit %d Windows',
|
||||
count,
|
||||
).format(count)
|
||||
|
||||
if (count > 0) {
|
||||
let quitFromTaskbarMenuText = ''
|
||||
if (count == 1) quitFromTaskbarMenuText = _('Quit')
|
||||
else
|
||||
quitFromTaskbarMenuText = ngettext(
|
||||
'Quit %d Window',
|
||||
'Quit %d Windows',
|
||||
count,
|
||||
).format(count)
|
||||
if (ungrouped) {
|
||||
this._quitAllItem.label.set_text(quitMultipleText)
|
||||
this._quitAllItem.visible = count > 1
|
||||
} else quitText = quitMultipleText
|
||||
|
||||
this._quitItem.label.set_text(quitFromTaskbarMenuText)
|
||||
}
|
||||
this._quitItem.visible = count > 0
|
||||
this._quitItem.label.set_text(quitText)
|
||||
}
|
||||
|
||||
_quitFromTaskbar() {
|
||||
_quitFromTaskbar(all) {
|
||||
let time = global.get_current_time()
|
||||
let windows = this.sourceActor.window // ungrouped applications
|
||||
? [this.sourceActor.window]
|
||||
: getInterestingWindows(this._app, this.sourceActor.dtpPanel.monitor)
|
||||
let windows =
|
||||
!all && this.sourceActor.window // ungrouped applications
|
||||
? [this.sourceActor.window]
|
||||
: getInterestingWindows(this._app, this.sourceActor.dtpPanel.monitor)
|
||||
|
||||
if (windows.length == this._app.get_windows().length)
|
||||
this._app.request_quit()
|
||||
@@ -1708,7 +1727,7 @@ export function ItemShowLabel() {
|
||||
let labelWidth = this.label.get_width()
|
||||
let labelHeight = this.label.get_height()
|
||||
|
||||
let position = this._dtpPanel.getPosition()
|
||||
let position = this._dtpPanel.geom.position
|
||||
let labelOffset = node.get_length('-x-offset')
|
||||
|
||||
let xOffset = Math.floor((itemWidth - labelWidth) / 2)
|
||||
@@ -1909,7 +1928,7 @@ export const ShowAppsIconWrapper = class extends EventEmitter {
|
||||
*/
|
||||
export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
||||
constructor(actor, dtpPanel) {
|
||||
super(actor, 0, dtpPanel.getPosition())
|
||||
super(actor, 0, dtpPanel.geom.position)
|
||||
|
||||
this._dtpPanel = dtpPanel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user