()
| 123 | } |
| 124 | |
| 125 | registerToSignals() { |
| 126 | this.signals.push({ |
| 127 | from: global.display, |
| 128 | id: global.display.connect('overlay-key', () => { |
| 129 | this.toggleOverview(); |
| 130 | }), |
| 131 | }); |
| 132 | |
| 133 | this.signals.push({ |
| 134 | from: this, |
| 135 | id: this.connect('captured-event', (_, event: Clutter.Event) => { |
| 136 | if (!this.overviewShown) return; |
| 137 | if (event.type() === Clutter.EventType.BUTTON_PRESS) { |
| 138 | const source = event.get_source(); |
| 139 | const [x, y] = event.get_coords(); |
| 140 | |
| 141 | // Note: The Clutter typing is incorrect. See https://gitlab.gnome.org/ewlsh/gi.ts/-/issues/2 |
| 142 | const [x1, y1] = this.panel.get_transformed_position() as [ |
| 143 | number, |
| 144 | number |
| 145 | ]; |
| 146 | const [width, height] = |
| 147 | this.panel.get_transformed_size() as [number, number]; |
| 148 | |
| 149 | if ( |
| 150 | !( |
| 151 | x >= x1 && |
| 152 | x <= x1 + width && |
| 153 | y >= y1 && |
| 154 | y <= y1 + height |
| 155 | ) |
| 156 | ) { |
| 157 | this.toggleOverview(); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | return Clutter.EVENT_PROPAGATE; |
| 162 | }), |
| 163 | }); |
| 164 | |
| 165 | this.signals.push({ |
| 166 | from: Me.msThemeManager, |
| 167 | id: Me.msThemeManager.connect('blur-background-changed', () => { |
| 168 | this.setBlurBackground(Me.msThemeManager.blurBackground); |
| 169 | }), |
| 170 | }); |
| 171 | |
| 172 | this.signals.push({ |
| 173 | from: Me.msWorkspaceManager, |
| 174 | id: Me.msWorkspaceManager.connect( |
| 175 | 'switch-workspace', |
| 176 | (_, from: number, to: number) => { |
| 177 | this.onSwitchWorkspace(from, to); |
| 178 | } |
| 179 | ), |
| 180 | }); |
| 181 | |
| 182 | this.signals.push({ |
no test coverage detected