Commit Graph

98 Commits

Author SHA1 Message Date
Lucas de Sena
ca04f20fec implement a table of atoms defined only once
Previously, adding a new atom into the code required:
1. In <icc.h>, add the line `extern Atom my_new_atom;` declaring the new atom.
2. In <icc.c>, add the line `Atom my_new_atom;` defining the new atom.
3. In <icc.c>, add the line `my_new_atom = XInternAtom(dpy, "MY_NEW_ATOM", False);`
   interning this new atom, and assigning the interned value to the variable.

Now, just add a line with the atom's name in the X-MACRO in <icc.h>, and
a XInternAtoms(3) and a set of macros will do the rest.

All new atoms will be referred to as an entry in the ATOMS[] array.
For example:

	ATOMS[MY_NEW_ATOM]

The exception are for those REALLY OLD atoms that have already a
dedicated compile-time-known value defined at <X11/Xatom.h>.  Those
do not need to be interned; and are referred to with a constant
beginning with the `XA_` prefix.  For example:

	XA_WM_CLASS
2026-02-19 20:22:50 +00:00
Adrian Chadd
f3fc2a7015 Merge pull request #26 from phillbush/localize
Localize
2026-02-05 03:38:04 +00:00
Adrian Chadd
0c23eb0126 Merge pull request #27 from phillbush/dialogs
make dialog clients be iconified/re-screened with their respective leader client
2026-02-05 03:37:04 +00:00
Lucas de Sena
6685043266 make dialog clients be iconified/re-screened with their respective leader client 2026-02-04 16:12:48 +00:00
Lucas de Sena
8a59e5cc9e localize control flow and variables
State and control flow for modal mouse actions (dragging/resizing/etc)
was fragmented and scattered through main.c, making code convoluted and
hard to maintain.

I fixed that by applying good structured programming practics:
implementing sub-event-loops for those modal actions, rather than
checking which modal action is currently in action at the main
event-loop.

That commit took me more time than i expected... abstract out all
spaghettish, global-state control flow into a single, encapsulated
scope for each modal action… test if i broke anything… find any dead
code that is not used anymore (implementing that global state we had
before)…

I also put some `static` in global variables and routines, so the
compile can warn whether an unused variable/function is defined (and
help me on removing dead code).
2026-01-31 01:52:24 +00:00
Lucas de Sena
5bbae05fec icc: use compound literal rather than static object to return pointer
thus make mkcmessage reentrant (and a macro, rather than a function)
2026-01-31 01:25:50 +00:00
Lucas de Sena
1212e7a78c document OpaqueResize/OpaqueMove 2026-01-30 01:54:19 +00:00
Adrian Chadd
0a400a366a Merge pull request #22 from phillbush/fullscreen
Make fullscreen work on GTK applications
2026-01-18 18:33:36 -08:00
Adrian Chadd
38913a983d Merge pull request #23 from phillbush/mandoc
ameliorate and rewrite manual in -mdoc format
2026-01-15 20:28:51 -08:00
Lucas de Sena
a33d487fab ameliorate and rewrite manual in -mdoc format
The AmiWM manual was kinda incomplete.  It does not describe how the WM
works, does not list all the configuration commands, nor the modules.

This commit rewrites the manual into the mandoc format, fill in the
gaps, and makes its section structure more standardized.
2026-01-16 00:43:57 +00:00
Lucas de Sena
a8f92b4e5b Make fullscreen work on GTK applications
This commit implements the _NET_SUPPORTING_WM_CHECK property, defined
by the EWMH[1] (Extended Window Management Hints, aka wm-spec), which
indicates that a EWMH-compliant window manager is running.

A GTK application, when set to go fullscreen, first checks root window's
_NET_SUPPORTING_WM_CHECK property to determine whether a EWMH-compliant
window manager is running; and then checks the _NET_SUPPORTED property
to determine the supported protocols.

_NET_SUPPORTED was previously implemented, but _NET_SUPPORTING_WM_CHECK
was not.


This commit also fixes a misconception of the code related to screens.

The code deals with two different, unrelated concepts of screens: the
X11 screen, and the AmiWM screen.

The X11 screen, created by the X server independently of whether a
window manager is running, is a kind of “subdisplay”.  A X11 display
structure, which describes a connection to the X server, has one or more
screens.  Each X11 screen has its own root window and its own set of
clients that are specific to it, and cannot move to another X11 screen.
The user can even run two different window managers at the same time in
the same display, given that each is run in a different X11 screen.
Usually, there is only one X11 screen.

The _NET_SUPPORTING_WM_CHECK and _NET_SUPPORTED properties must be set
on the root window of each screen that AmiWM is managing.  Previously,
however, they were set everytime an AmiWM screen (a totally different
concept) was realized.  So, if i had 4 AmiWM screens configured in my
~/.amiwmrc file, setsupports() were called four times, even if i only
have a single X11 screen.

[1]: https://specifications.freedesktop.org/wm/latest/index.html
2026-01-10 02:58:39 +00:00
Adrian Chadd
d3be9b113f Merge pull request #21 from chewi/bmake-yacc
Fix GNUism in Makefile regarding yacc
2023-12-22 17:31:26 -08:00
James Le Cuirot
d148a44402 Fix GNUism in Makefile regarding yacc
Tested with bmake.
2023-12-22 23:39:47 +00:00
Adrian Chadd
78b416044c Merge pull request #19 from chewi/yacc
Adjust yacc builds to support the original yacc (as opposed to bison)
2023-12-21 22:13:14 -08:00
Adrian Chadd
00025ae390 Merge pull request #20 from erikarn/main
[amiwm] Update to 0.22pl2
2023-12-21 22:11:13 -08:00
Adrian Chadd
def62797f9 [amiwm] Update to 0.22pl2
This notably includes full screen support!

Addresses Issue #12
2023-12-21 22:09:25 -08:00
James Le Cuirot
5823492992 Adjust yacc builds to support the original yacc (as opposed to bison)
yacc doesn't support the arguments we've been giving to bison. byacc was
also tested.
2023-10-08 22:15:32 +01:00
James Le Cuirot
a010c4406f Drop obsolete smakefile
This appears to be for the ye olde SAS/C compiler! It wouldn't work now,
even if you did have that.
2023-10-08 22:15:28 +01:00
James Le Cuirot
f1e182de80 Add "Filesystem" and "Launcher" to git ignore file 2023-10-08 22:15:25 +01:00
Adrian Chadd
9b3846e15a Merge pull request #18 from chewi/build
Various build fixes and improvements
2023-10-07 17:55:57 -07:00
James Le Cuirot
147cb92b7f Respect ${AR} when building
Unfortunately, there is no AC_PROG_AR yet.
2023-10-07 23:03:03 +01:00
James Le Cuirot
0f16b49701 Fix implicit declaration of exit() during configure script 2023-10-07 23:03:00 +01:00
James Le Cuirot
c7b5bbe441 ksh is not installed on modern systems, assume some POSIX shell 2023-10-07 23:02:57 +01:00
James Le Cuirot
c3185246ca Use the noyywrap lex option instead of adding hacky yywrap functions 2023-10-07 23:02:54 +01:00
James Le Cuirot
d91710ba03 Fix all implicit declarations
AC_HEADER_TIME is only needed if you need to include time.h and
sys/time.h at the same time.

The truth is this codebase is an unholy mess but at least this fixes
the warnings.
2023-10-07 23:02:51 +01:00
James Le Cuirot
cf6e360a7e Respect LDFLAGS 2023-10-07 23:02:48 +01:00
James Le Cuirot
34c0c7af02 Fix parallel builds 2023-10-07 23:02:44 +01:00
James Le Cuirot
9978760d7f Fix various path issues 2023-10-07 23:02:40 +01:00
James Le Cuirot
f1bcd15eb6 Update install-sh to a more modern version 2023-10-07 23:02:19 +01:00
James Le Cuirot
798adaa45b configure.in should be named configure.ac these days 2023-10-07 23:02:14 +01:00
James Le Cuirot
a9d59a9fd4 Delete generated configure script and ignore all build/generated files
These should not be in the repository.
2023-10-02 08:44:11 +01:00
James Le Cuirot
3c29995649 Support make install DESTDIR=/foo just like Automake does
Distributions really need this.
2023-10-02 08:42:15 +01:00
Adrian Chadd
f77c715b24 Merge pull request #11 from erikarn/main
[amiwm] lots of little fixes to amiwm over the last 6 months
2023-06-12 19:16:44 -07:00
Adrian Chadd
87ba044ea4 [libami] handle EINTR from select() as a non-error
EINTR is happening during suspend/resume, which was causing all of
the modules to die (and requiring a restart of amiwm to re-run all
of its modules.)

This fixes things in FreeBSD suspend/resume so, well, the modules
keep working. :)
2023-06-12 11:39:41 -07:00
Adrian Chadd
1a8a15e24f [amiwm] add a missing Makefile depedency
This isn't completely enough to make this build with gmake -j, but it's
one of many things that are missing.
2023-06-12 11:39:41 -07:00
Adrian Chadd
ecf427324c Merge branch 'ahc_20220523_move_window_desktop' 2023-01-15 20:53:02 -08:00
Adrian Chadd
9ce1822bff [amiwm] remove now dead code. 2023-01-15 20:51:47 -08:00
Adrian Chadd
93863ec396 [amiwm] add a .gitignore so I don't see / commit .o files 2022-11-23 18:11:27 -08:00
Adrian Chadd
631176c9a2 [amiwm] Implement a keyboard shortcut to move a client to a different screen
This allows a keyboard shortcut to move a client to a different amiwm
screen.  That way when you have things like Firefox restart every window
in a single screen, you can quickly move screens to where they should be.
2022-09-05 16:06:18 -07:00
Adrian Chadd
c0450d83bc Merge branch 'main' of github.com:erikarn/amiwm-2 2022-09-05 16:05:52 -07:00
Adrian Chadd
229d2b2c4d [amiwm] Fix NULL scr issue
If the clock timer fires when global scr is NULL then we end up calling
redrawmenubar() with a NULL global scr, but a valid local scr.

So just pass in the scr used when doing "stuff" into redrawmenubar(),
making the 'scr' in redrawmenubar() also local scope.
2022-09-05 16:03:55 -07:00
Adrian Chadd
5577e78cc8 Merge pull request #10 from erikarn/20220618_fix_make
[amiwm] Fix make rules to work under BSD make
2022-06-18 19:14:59 -07:00
Adrian Chadd
918365056b [amiwm] Fix make rules to work under BSD make
* fix whitespace
* filesystem / jokefs rule implication stuff was working fine in GNU make
  but not in BSD make, so fix it there
* Remove the $(srcdir)/module thing, because it was tripping up BSD make
  rules.  The "./" is just making it angry.

Tested:

* FreeBSD, gmake and make
2022-06-18 19:13:03 -07:00
Adrian Chadd
feb42adcc6 Merge pull request #8 from justindossey/20220525_update_man_page
Correct filenames for README and MODULES
2022-05-25 10:28:43 -07:00
Justin Dossey
e6f7a1bc17 Correct filenames for README and MODULES
The README file in this repo is called README.md and the old
README.modules is now named MODULES.md. Changed references to those
files (including in the man page) to reflect what is in the repo today.
2022-05-25 10:06:37 -07:00
Adrian Chadd
21423a0c10 Merge pull request #6 from erikarn/20220511_fix_keyboard_docs
[amiwm] Fix keyboard documentation entry
2022-05-21 16:06:33 -07:00
Adrian Chadd
f116f9c335 Merge pull request #5 from erikarn/ahc_20220425_menu_widgets
This is the beginning of adding some battery display support into the menu and figuring out how to add arbitrary widgets into the menu bar.

It's going to take a bunch more commits / time to clean this up to be more flexible, but at least now we have an MVP of adding a new "thing", buggy as it is.
2022-05-21 16:05:17 -07:00
Adrian Chadd
2a9bd912a1 [amiwm] Add the basic battery info printing bits
* add a batteryinfo config option to enable whether or not to display
  the current battery info string

* populate that battery info string whenever we receive a battery
  update from the module

* document it all

This is very specific to a battery thing rather than a generic menu
widget thing, but I think I'll go and twiddle with this stuff a bit
more first and then work on a more generic "menu widget" thing later.

It'd be nice to have "menu bar things" like battery and the date/time
field on a linked list of "things".

There's also some bugs - notably, rendering artifacts when the
string length shrinks, and it only updating on the 'current' menu bar
(when you have multiple desktops visible at once.)  Those also
should be fixed for completeness. :-)
2022-05-15 19:36:03 -07:00
Adrian Chadd
fc23b3e054 [battery] Add help on how the battery module works. 2022-05-15 10:50:55 -07:00
Adrian Chadd
915b84e403 [battery] Update to not spit out debugging
Now that this actually seems to work, let's not spit out so much
debugging info.  It's not needed!

Whilst here quieten a debugging output.
2022-05-15 10:49:17 -07:00