11// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
22
33const Clutter = imports . gi . Clutter ;
4- const Gdk = imports . gi . Gdk ;
54const Gio = imports . gi . Gio ;
65const GLib = imports . gi . GLib ;
76const GObject = imports . gi . GObject ;
@@ -16,21 +15,6 @@ const LEVEL_ANIMATION_TIME = 100;
1615const FADE_TIME = 100 ;
1716const HIDE_TIMEOUT = 1500 ;
1817
19- function convertGdkIndex ( monitorIndex ) {
20- let screen = Gdk . Screen . get_default ( ) ;
21- let rect = screen . get_monitor_geometry ( monitorIndex ) ;
22- let cx = rect . x + rect . width / 2 ;
23- let cy = rect . y + rect . height / 2 ;
24- for ( let i = 0 ; i < Main . layoutManager . monitors . length ; i ++ ) {
25- let monitor = Main . layoutManager . monitors [ i ] ;
26- if ( cx >= monitor . x && cx < monitor . x + monitor . width &&
27- cy >= monitor . y && cy < monitor . y + monitor . height )
28- monitorIndex = i ;
29- }
30-
31- return monitorIndex ;
32- } ;
33-
3418var OsdWindow = GObject . registerClass (
3519class OsdWindow extends Clutter . Actor {
3620 _init ( monitorIndex ) {
@@ -199,13 +183,11 @@ var OsdWindowManager = class {
199183 this . _osdWindows [ monitorIndex ] . show ( ) ;
200184 }
201185
202- show ( monitorIndex , icon , label , level , convertIndex ) {
186+ show ( monitorIndex , icon , label , level ) {
203187 if ( this . _osdWindows . length === 0 )
204188 return ;
205189
206190 if ( monitorIndex !== - 1 ) {
207- if ( convertIndex )
208- monitorIndex = convertGdkIndex ( monitorIndex ) ;
209191 for ( let i = 0 ; i < this . _osdWindows . length ; i ++ ) {
210192 if ( i === monitorIndex )
211193 this . _showOsdWindow ( i , icon , label , level ) ;
0 commit comments