[amiwm] remove the global 'front' variable

This is a pretty straight forward change to remove the global front
variable and instead use a couple of accessor functions.

This hopefully will make it easier to keep track and debug when
the front screen changes.
This commit is contained in:
Adrian Chadd
2022-03-28 20:44:24 -07:00
parent 84caa252d1
commit d00be9ffa8
8 changed files with 66 additions and 47 deletions

4
gram.y
View File

@@ -103,8 +103,8 @@ stmt : error
| SCREEN string { openscreen($2,DefaultRootWindow(dpy)); }
| SCREEN NUMBER string { if(($2==DefaultScreen(dpy)||prefs.manage_all) && $2<ScreenCount(dpy)) openscreen($3,RootWindow(dpy,$2)); }
| MODULEPATH string { prefs.module_path = $2; }
| MODULE string STRING { create_module((front? front->upfront:NULL), $2, $3); }
| MODULE string { create_module((front? front->upfront:NULL), $2, NULL); }
| MODULE string STRING { create_module((get_front_scr() ? get_front_scr()->upfront:NULL), $2, $3); }
| MODULE string { create_module((get_front_scr() ? get_front_scr()->upfront:NULL), $2, NULL); }
| INTERSCREENGAP NUMBER { prefs.borderwidth=$2; }
| AUTORAISE truth { prefs.autoraise=$2; }
| OPAQUEMOVE truth { prefs.opaquemove=$2; }