summarylogtreecommitdiffstats
path: root/minus-galaplugin.patch
blob: a4db0673fbe58128899708bc810dbe5e723dd59a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
--- src/wingpanel/wingpanel-interface/Main.vala	2017-10-12 18:58:46.125181484 +0900
+++ /dev/null	2017-10-12 18:36:39.960762875 +0900
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- */
-
-/*
- *   This plugin adds a dbus-interface to gala that provides additional information
- *   about windows and workspaces for the panel.
- */
-
-public class WingpanelInterface.Main : Gala.Plugin {
-    private const string DBUS_NAME = "org.pantheon.gala.WingpanelInterface";
-    private const string DBUS_PATH = "/org/pantheon/gala/WingpanelInterface";
-
-    public static Gala.WindowManager wm;
-    public static Meta.Screen screen;
-
-    private DBusConnection? dbus_connection = null;
-
-    public override void initialize (Gala.WindowManager _wm) {
-        if (_wm == null) {
-            return;
-        }
-
-        wm = _wm;
-        screen = wm.get_screen ();
-
-        Bus.own_name (BusType.SESSION,
-                      DBUS_NAME,
-                      BusNameOwnerFlags.NONE,
-                      on_bus_aquired,
-                      null,
-                      () => warning ("Aquirering \"%s\" failed.", DBUS_NAME));
-    }
-
-    public override void destroy () {
-        try {
-            if (dbus_connection != null) {
-                dbus_connection.close_sync ();
-            }
-        } catch (Error e) {
-            warning ("Closing DBus service failed: %s", e.message);
-        }
-    }
-
-    private void on_bus_aquired (DBusConnection connection) {
-        dbus_connection = connection;
-
-        try {
-            var server = new DBusServer ();
-
-            dbus_connection.register_object (DBUS_PATH, server);
-
-            debug ("DBus service registered.");
-        } catch (Error e) {
-            warning ("Registering DBus service failed: %s", e.message);
-        }
-    }
-}
-
-public Gala.PluginInfo register_plugin () {
-    return {
-               "wingpanel-interface",
-               "Wingpanel Developers",
-               typeof (WingpanelInterface.Main),
-               Gala.PluginFunction.ADDITION,
-               Gala.LoadPriority.IMMEDIATE
-    };
-}
--- src/wingpanel/wingpanel-interface/Settings.vala	2017-10-12 18:58:46.125181484 +0900
+++ /dev/null	2017-10-12 18:36:39.960762875 +0900
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- */
-
-public class WingpanelInterface.AnimationSettings : Granite.Services.Settings {
-    public bool enable_animations { get; set; }
-    public int open_duration { get; set; }
-    public int snap_duration { get; set; }
-    public int close_duration { get; set; }
-    public int minimize_duration { get; set; }
-    public int workspace_switch_duration { get; set; }
-    public int menu_duration { get; set; }
-
-    static AnimationSettings? instance = null;
-
-    private AnimationSettings () {
-        base ("org.pantheon.desktop.gala.animations");
-    }
-
-    public static unowned AnimationSettings get_default () {
-        if (instance == null) {
-            instance = new AnimationSettings ();
-        }
-
-        return instance;
-    }
-}
--- src/wingpanel/wingpanel-interface/FocusManager.vala	2017-10-12 18:58:46.125181484 +0900
+++ /dev/null	2017-10-12 18:36:39.960762875 +0900
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- */
-
-public class WingpanelInterface.FocusManager : Object {
-    private static FocusManager? instance = null;
-
-    private Meta.Workspace? current_workspace = null;
-    private Meta.Window? last_focused_window = null;
-
-    public FocusManager () {
-        Main.screen.workspace_switched.connect (() => {
-            update_current_workspace ();
-        });
-
-        update_current_workspace ();
-    }
-
-    public void remember_focused_window () {
-        var windows = current_workspace.list_windows ();
-
-        foreach (Meta.Window window in windows) {
-            if (window.has_focus ()) {
-                last_focused_window = window;
-
-                return;
-            }
-        }
-    }
-
-    public void restore_focused_window () {
-        if (last_focused_window != null) {
-            var display = Main.screen.get_display ();
-            last_focused_window.focus (display.get_current_time ());
-        }
-    }
-
-    private void update_current_workspace () {
-        var workspace = Main.screen.get_workspace_by_index (Main.screen.get_active_workspace_index ());
-
-        if (workspace == null) {
-            warning ("Cannot get active workspace");
-
-            return;
-        }
-
-        current_workspace = workspace;
-    }
-
-    public static FocusManager get_default () {
-        if (instance == null) {
-            instance = new FocusManager ();
-        }
-
-        return instance;
-    }
-}
--- src/wingpanel/wingpanel-interface/DBusServer.vala	2017-10-13 03:00:24.840092343 +0900
+++ /dev/null	2017-10-13 01:49:26.502721048 +0900
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- */
-
-[DBus (name = "org.pantheon.gala.WingpanelInterface")]
-public class WingpanelInterface.DBusServer : Object {
-    private BackgroundManager background_manager;
-
-    public signal void state_changed (BackgroundState state, uint animation_duration);
-
-    public void initialize (int monitor, int panel_height) {
-        background_manager = new BackgroundManager (monitor, panel_height);
-        background_manager.state_changed.connect ((state, animation_duration) => {
-            state_changed (state, animation_duration);
-        });
-    }
-
-    public void remember_focused_window () {
-        FocusManager.get_default ().remember_focused_window ();
-    }
-
-    public void restore_focused_window () {
-        FocusManager.get_default ().restore_focused_window ();
-    }
-}
--- src/wingpanel/CMakeLists.txt	2017-10-13 03:25:28.007664080 +0900
+++ src/wingpanel/CMakeLists.txt.new	2017-10-13 03:27:00.135900068 +0900
@@ -121,8 +121,6 @@
 set (DEPS_LIBRARIES ${DEPS_LIBRARIES} ${LIB_NAME})
 add_subdirectory (src)
 
-add_subdirectory (wingpanel-interface)
-
 if (BUILD_SAMPLE)
   add_subdirectory (sample)
 endif ()
--- src/wingpanel/wingpanel-interface/CMakeLists.txt	2018-03-05 15:53:08.967254520 +0900
+++ /dev/null	2018-03-05 14:42:26.994151215 +0900
@@ -1,90 +0,0 @@
-find_package (PkgConfig)
-
-pkg_check_modules (PLUGIN REQUIRED gala granite)
-
-add_definitions (${PLUGIN_CFLAGS})
-link_directories (${PLUGIN_LIBRARY_DIRS})
-set (WINGPANELINTERFACE "wingpanel-interface")
-
-find_package (Vala REQUIRED)
-include (ValaVersion)
-ensure_vala_version ("0.12.0" MINIMUM)
-
-# We need to know which version of the Mutter API is in use
-pkg_check_modules(MUTTER320 QUIET libmutter>=3.19)
-pkg_check_modules(MUTTER322 QUIET libmutter>=3.21)
-pkg_check_modules(MUTTER324 QUIET libmutter-0>=3.23.90)
-pkg_check_modules(MUTTER326 QUIET libmutter-1>=3.25.90)
-pkg_check_modules(MUTTER328 QUIET libmutter-2>=3.27.91)
-
-set (EXTRA_VALA_FLAGS "")
-set (EXTRA_MUTTER_PKS cogl-1.0 clutter-1.0 libmutter)
-set (EXTRA_MUTTER_PACKAGES cogl-1.0 clutter-1.0 libmutter)
-if (MUTTER320_FOUND)
-    set (EXTRA_VALA_FLAGS ${EXTRA_VALA_FLAGS} --define HAS_MUTTER320)
-endif ()
-
-if (MUTTER322_FOUND)
-    set (EXTRA_VALA_FLAGS ${EXTRA_VALA_FLAGS} --define HAS_MUTTER322)
-    set (EXTRA_MUTTER_PKS mutter-cogl-1.0 mutter-cogl-pango-1.0 mutter-cogl-path-1.0 mutter-clutter-1.0 libmutter)
-    set (EXTRA_MUTTER_PACKAGES mutter-cogl-1.0 mutter-clutter-1.0)
-endif ()
-
-if (MUTTER324_FOUND)
-    set (EXTRA_VALA_FLAGS ${EXTRA_VALA_FLAGS} --define HAS_MUTTER320 --define HAS_MUTTER322 --define HAS_MUTTER324)
-    set (EXTRA_MUTTER_PKS mutter-cogl-0 mutter-cogl-pango-0 mutter-cogl-path-0 mutter-clutter-0 libmutter-0)
-    set (EXTRA_MUTTER_PACKAGES mutter-cogl-0 mutter-clutter-0)
-endif ()
-
-if (MUTTER326_FOUND)
-    set (EXTRA_VALA_FLAGS ${EXTRA_VALA_FLAGS} --define HAS_MUTTER320 --define HAS_MUTTER322 --define HAS_MUTTER324 --define HAS_MUTTER326)
-    set (EXTRA_MUTTER_PKS mutter-cogl-1 mutter-cogl-pango-1 mutter-cogl-path-1 mutter-clutter-1 libmutter-1)
-    set (EXTRA_MUTTER_PACKAGES mutter-cogl-1 mutter-clutter-1)
-endif ()
-
-if (MUTTER328_FOUND)
-    set (EXTRA_VALA_FLAGS ${EXTRA_VALA_FLAGS} --define HAS_MUTTER320 --define HAS_MUTTER322 --define HAS_MUTTER324 --define HAS_MUTTER326 --define HAS_MUTTER328)
-    set (EXTRA_MUTTER_PKS mutter-cogl-2 mutter-cogl-pango-2 mutter-cogl-path-2 mutter-clutter-2 libmutter-2)
-    set (EXTRA_MUTTER_PACKAGES mutter-cogl-2 mutter-clutter-2)
-endif ()
-
-pkg_check_modules (PLUGIN_MUTTER REQUIRED ${EXTRA_MUTTER_PKS})
-
-include (ValaPrecompile)
-vala_precompile (VALA_C ${WINGPANELINTERFACE}
-  Main.vala
-  DBusServer.vala
-  BackgroundManager.vala
-  FocusManager.vala
-  Settings.vala
-  Utils.vala
-PACKAGES
-  gala
-  granite
-  cogl-fixes
-  ${EXTRA_MUTTER_PACKAGES}
-OPTIONS
-  --thread
-  --vapidir=${CMAKE_SOURCE_DIR}/vapi
-  ${EXTRA_VALA_FLAGS}
-)
-
-add_library (${WINGPANELINTERFACE} MODULE ${VALA_C})
-target_link_libraries(${WINGPANELINTERFACE} ${PLUGIN_LIBRARIES} ${PLUGIN_MUTTER_LIBRARIES} m)
-
-# Add -rpath ldflag if libgala is using mutter >= 3.21 to pick up libmutter-*.so
-if (MUTTER328_FOUND)
-  _pkgconfig_invoke("libmutter-2" MUTTER TYPELIB_DIR "" "--variable=typelibdir")
-  set_target_properties(${WINGPANELINTERFACE} PROPERTIES LINK_FLAGS -Wl,-rpath,${MUTTER_TYPELIB_DIR})
-elseif (MUTTER326_FOUND)
-  _pkgconfig_invoke("libmutter-1" MUTTER TYPELIB_DIR "" "--variable=typelibdir")
-  set_target_properties(${WINGPANELINTERFACE} PROPERTIES LINK_FLAGS -Wl,-rpath,${MUTTER_TYPELIB_DIR})
-elseif (MUTTER324_FOUND)
-  _pkgconfig_invoke("libmutter-0" MUTTER TYPELIB_DIR "" "--variable=typelibdir")
-  set_target_properties(${WINGPANELINTERFACE} PROPERTIES LINK_FLAGS -Wl,-rpath,${MUTTER_TYPELIB_DIR})
-elseif (MUTTER322_FOUND)
-  _pkgconfig_invoke("libmutter" MUTTER TYPELIB_DIR "" "--variable=typelibdir")
-  set_target_properties(${WINGPANELINTERFACE} PROPERTIES LINK_FLAGS -Wl,-rpath,${MUTTER_TYPELIB_DIR})
-endif ()
-
-install (TARGETS ${WINGPANELINTERFACE} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/gala/plugins)
--- src/wingpanel/wingpanel-interface/Utils.vala	2018-05-13 16:35:27.438070885 +0900
+++ /dev/null	2018-05-12 19:49:31.706719886 +0900
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- */
-
-/*
- *   The method for calculating the background information and the classes that are
- *   related to it are copied from Gala.DBus.
- */
-
-namespace WingpanelInterface.Utils {
-    private const double SATURATION_WEIGHT = 1.5;
-    private const double WEIGHT_THRESHOLD = 1.0;
-
-    private class DummyOffscreenEffect : Clutter.OffscreenEffect {
-        public signal void done_painting ();
-
-        public override void post_paint () {
-            base.post_paint ();
-            Idle.add (() => {
-                done_painting ();
-                return false;
-            });
-        }
-    }
-
-    public struct ColorInformation {
-        double average_red;
-        double average_green;
-        double average_blue;
-        double mean_luminance;
-        double luminance_variance;
-        double mean_acutance;
-    }
-
-    public async ColorInformation get_background_color_information (Gala.WindowManager wm, int monitor,
-                                                                    int reference_x, int reference_y, int reference_width, int reference_height) throws DBusError {
-        var background = wm.background_group.get_child_at_index (monitor);
-
-        if (background == null) {
-            throw new DBusError.INVALID_ARGS ("Invalid monitor requested: %i".printf (monitor));
-        }
-
-        var effect = new DummyOffscreenEffect ();
-        background.add_effect (effect);
-
-        var tex_width = (int)background.width;
-        var tex_height = (int)background.height;
-
-        int x_start = reference_x;
-        int y_start = reference_y;
-        int width = int.min (tex_width - reference_x, reference_width);
-        int height = int.min (tex_height - reference_y, reference_height);
-
-        if (x_start > tex_width || x_start > tex_height || width <= 0 || height <= 0) {
-            throw new DBusError.INVALID_ARGS ("Invalid rectangle specified: %i, %i, %i, %i".printf (x_start, y_start, width, height));
-        }
-
-        double mean_acutance = 0, variance = 0, mean = 0, rTotal = 0, gTotal = 0, bTotal = 0;
-        ulong paint_signal_handler = 0;
-
-        paint_signal_handler = effect.done_painting.connect (() => {
-            SignalHandler.disconnect (effect, paint_signal_handler);
-            background.remove_effect (effect);
-
-            var texture = (Cogl.Texture)effect.get_texture ();
-            var pixels = new uint8[texture.get_width () * texture.get_height () * 4];
-            var pixel_lums = new double[texture.get_width () * texture.get_height ()];
-
-            CoglFixes.texture_get_data (texture, Cogl.PixelFormat.BGRA_8888_PRE, 0, pixels);
-
-            int size = width * height;
-
-            double mean_squares = 0;
-            double pixel = 0;
-
-            double max, min, score, delta, scoreTotal = 0, rTotal2 = 0, gTotal2 = 0, bTotal2 = 0;
-
-            /*
-             * code to calculate weighted average color is copied from
-             * plank's lib/Drawing/DrawingService.vala average_color()
-             * http://bazaar.launchpad.net/~docky-core/plank/trunk/view/head:/lib/Drawing/DrawingService.vala
-             */
-            for (int y = y_start; y < height; y++) {
-                for (int x = x_start; x < width; x++) {
-                    int i = y * width * 4 + x * 4;
-
-                    uint8 r = pixels[i];
-                    uint8 g = pixels[i + 1];
-                    uint8 b = pixels[i + 2];
-
-                    pixel = (0.3 * r + 0.59 * g + 0.11 * b) ;
-                    
-                    pixel_lums[y * width + x] = pixel;
-
-                    min = uint8.min (r, uint8.min (g, b));
-                    max = uint8.max (r, uint8.max (g, b));
-
-                    delta = max - min;
-
-                    /* prefer colored pixels over shades of grey */
-                    score = SATURATION_WEIGHT * (delta == 0 ? 0.0 : delta / max);
-
-                    rTotal += score * r;
-                    gTotal += score * g;
-                    bTotal += score * b;
-                    scoreTotal += score;
-
-                    rTotal += r;
-                    gTotal += g;
-                    bTotal += b;
-
-                    mean += pixel;
-                    mean_squares += pixel * pixel;
-                }
-            }
-            
-            for (int y = y_start + 1; y < height - 1; y++) {
-                for (int x = x_start + 1; x < width - 1; x++) {
-                    var acutance =
-                        (pixel_lums[y * width + x] * 4) -
-                        (
-                            pixel_lums[y * width + x - 1] +
-                            pixel_lums[y * width + x + 1] +
-                            pixel_lums[(y - 1) * width + x] +
-                            pixel_lums[(y + 1) * width + x]
-                        );
-                    
-                    mean_acutance += acutance > 0 ? acutance : -acutance;
-                }
-            }
-
-            scoreTotal /= size;
-            bTotal /= size;
-            gTotal /= size;
-            rTotal /= size;
-
-            if (scoreTotal > 0.0) {
-                bTotal /= scoreTotal;
-                gTotal /= scoreTotal;
-                rTotal /= scoreTotal;
-            }
-
-            bTotal2 /= size * uint8.MAX;
-            gTotal2 /= size * uint8.MAX;
-            rTotal2 /= size * uint8.MAX;
-
-            /*
-             * combine weighted and not weighted sum depending on the average "saturation"
-             * if saturation isn't reasonable enough
-             * s = 0.0 -> f = 0.0 ; s = WEIGHT_THRESHOLD -> f = 1.0
-             */
-            if (scoreTotal <= WEIGHT_THRESHOLD) {
-                var f = 1.0 / WEIGHT_THRESHOLD * scoreTotal;
-                var rf = 1.0 - f;
-
-                bTotal = bTotal * f + bTotal2 * rf;
-                gTotal = gTotal * f + gTotal2 * rf;
-                rTotal = rTotal * f + rTotal2 * rf;
-            }
-
-            /* there shouldn't be values larger then 1.0 */
-            var max_val = double.max (rTotal, double.max (gTotal, bTotal));
-
-            if (max_val > 1.0) {
-                bTotal /= max_val;
-                gTotal /= max_val;
-                rTotal /= max_val;
-            }
-
-            mean /= size;
-            mean_squares = mean_squares / size;
-
-            variance = (mean_squares - (mean * mean));
-            
-            mean_acutance /= (width - 2) * (height - 2);
-
-            get_background_color_information.callback ();
-        });
-
-        background.queue_redraw ();
-
-        yield;
-
-        return { rTotal, gTotal, bTotal, mean, variance, mean_acutance };
-    }
-
-}