Commit Graph

99 Commits

Author SHA1 Message Date
okan
4811ec0433 Refactor callbacks to take a void * so as to not try and generalize into
client_ctx in keypress and buttonpress event handlers; pass appropriate *ctx's
based on context.

While here, limit some globals, replace defines with appropriate variables and
fix some naming.
2016-10-18 17:03:30 +00:00
okan
035ba40ddc no need to unmap menu window again 2016-09-29 00:30:40 +00:00
okan
1b369f6063 Mechanical change: move screen menu bits to their own struct. 2016-09-29 00:21:55 +00:00
okan
4db32a8463 pledge "stdio rpath proc exec" cwm before main event loop, after
init/setup - mostly for menu building.

ok semarie@ (another cwm user)
2015-11-12 17:56:54 +00:00
okan
0abb5fd0f1 Start cleaning up name vs function differences; replace magic numbers. 2015-11-10 20:05:33 +00:00
okan
c10cac3b1e On execwm, we should properly release resources before exec'ing into a
new window manager; so allow CWM_EXEC_WM to assign new wm to wm_argv and
pass through cwm_status (now EXECWM) so that x_teardown() gets called
before exec'ing the new window manager.  Removes the need for a separate
x_restart() now, using new wm_argv; and consolidates errno for execvp.
2015-09-16 17:58:25 +00:00
okan
c199720bcc Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAX
and HOST_NAME_MAX+1, respectively.

ok doug@
2015-01-19 14:54:16 +00:00
okan
0fefd96f3e Remove duplicate client queue (mruq); instead, remove and take the
global Clientq and place it inside screen_ctx since every client belongs
to a screen, then use the same per screen clientq to track stacking
order (the sole reason for mruq).
2014-09-08 20:11:22 +00:00
okan
c4e86dacb9 more style nits 2014-09-07 19:27:30 +00:00
okan
28f5392d74 generic sighandler 2014-09-06 16:24:32 +00:00
okan
03847f1c2e No need to store screen colormap and visual; rather just use the X
macros in the one place they are needed.
2014-02-02 16:29:04 +00:00
okan
d413fd6b56 Let the config parser continue parsing even after encountering an error;
original idea (with now-outdated patch) from Thomas Adam.  Since we now
report where errors exist, this now makes more sense.  Expand a bit on
config file parsing in the cwm(1).

Discussed with a few, including sthen; ok sthen.
2014-02-01 00:25:04 +00:00
okan
e395fd7bea Move conf_init/clear into main - no behaviour change; from Tiago Cunha. 2014-01-28 00:42:20 +00:00
okan
fa2846fe29 cwm_argv doesn't need to be global any longer 2014-01-22 22:26:05 +00:00
okan
3aff0ea880 start properly releasing X resources during teardown 2014-01-22 22:14:02 +00:00
okan
3b8ad25f38 Somewhat streamline event loop/restart/quit handling; most notable
change allows a restart to trigger proper teardown first, even though
teardown is not (yet) complete.

After some discussion with oga@nicotinebsd.org regarding a more
complicated version/idea.
2014-01-22 21:48:27 +00:00
okan
b92e846e56 Sprinkle a few more const; from Tiago Cunha. 2014-01-21 15:42:44 +00:00
okan
72ccee09ff use consistent types 2014-01-03 15:29:06 +00:00
okan
e5da774880 ICCCM explicitly states that server time (CurrentTime) should *not* be
used for focus events, but rather the timestamp of the generated event.
Track the last event timestamp and send it down for a WM_TAKE_FOCUS
ClientMessage.  I suspect we should do this for clients that don't
announce this Atom as well, though the raciness gets us into a bind.

Solves focus order issue since WM_TAKE_FOCUS; fix verified by sthen@

ok sthen@
2013-12-12 20:15:07 +00:00
okan
1ca1aa39ab simplify atom handling; allows us to limit to one round-trip to server
for gathering Atoms.
2013-07-15 14:50:44 +00:00
okan
2993105e89 whitespace and style fixes; from Tiago Cunha and one from me. 2013-07-08 15:46:16 +00:00
okan
537fe7febb move Cursors into conf. 2013-06-17 17:11:10 +00:00
okan
8b4f5be847 now that we have conf_screen, which configures individual screens
*after* config parsing, we no longer need to split up display/screen
initialization, so collapse.
2013-06-17 14:08:51 +00:00
okan
5496d2b0c6 get rid of long standing XXX: now that we configure screens based on
config options, add the keybinding GrabKey calls here
2013-05-22 16:54:09 +00:00
okan
a6a2d45671 if -> ifdef 2013-05-14 13:39:53 +00:00
okan
5e28ed99db makes no sense to set an error handler which uses X_Dpy before XOpenDisplay. 2013-04-12 14:49:16 +00:00
okan
0b6abd364f push Screenq into screen_init 2013-04-12 14:46:30 +00:00
okan
44784133e7 simplify config file setup; with Tiago Cunha 2012-12-18 00:14:41 +00:00
okan
eabe498038 pull user home directory via getenv or getpwuid and stash it so we don't
need to do this everytime; with Tiago Cunha
2012-12-17 23:03:41 +00:00
okan
52982ae188 non-trivial menu drawing rewrite, moving to Xft and solving various
font/color drawing issues; from Alexander Polakov
2012-12-17 02:28:45 +00:00
okan
00eccbe44f zap extra lines 2012-11-29 16:50:03 +00:00
okan
ddf27615e6 x_setupscreen -> screen_init; no functional change. 2012-11-29 03:54:46 +00:00
okan
4f78cb6835 sort 2012-11-09 03:52:02 +00:00
okan
34267fe638 replace 'reload' with 'restart', which merely re-exec's cwm using the
existing argv; same idea with respect to argv saving as Alexander
Polakov.  reload support was half-complete and is getting in the way.

agreed to by many
2012-10-31 19:30:19 +00:00
okan
f4e0469f06 support multibyte input to menu code; from Alexander Polakov with a tiny tweak. 2012-08-07 14:05:49 +00:00
okan
9e50f2e028 Further simplify Xinerama init and re-init on XRR events.
While testing for Xinerama during setup was done display-wide, each time
XineramaQueryScreens() is called either in start-up or due to an XRR
event, the library re-tests for the Xinerama extension anyway before
moving on; so the initial test is redundant and allows another global to
go away with one other change: always fill in sc->xinerama (and _no),
regardless of the success of malloc in XineramaQueryScreens(), and use
it to see if Xinerama dimensions exist when asked by client and/or menu
code.
2012-07-18 21:53:22 +00:00
okan
37bdf57a02 querying for Xinerama should be done per display, not per screen, so
move chuck to display init; allows some shuffling to occur limiting
screen_init_xinerama()'s scope while keeping order intact.
2012-07-06 14:18:00 +00:00
okan
43b628a3d0 the display's width and height are updated after an XRandR event so we
don't need to pass down the new values to screen_update_geometry(); so
just read the width/height values directly for both uses of
screen_update_geometry().  prep for further changes in this area.
2012-07-05 17:35:13 +00:00
okan
838f6a5713 instead of using the menu window for _NET_SUPPORTING_WM_CHECK, create a
dummy one to use instead; allows us to not have to wait for menu_init(),
so re-shuffle _NET_SUPPORTED slightly.

ok sthen@
2012-05-16 01:17:14 +00:00
okan
6dcdd18c5a knf, some from a diff from Tiago Cunha. 2012-05-13 15:15:54 +00:00
okan
3f2d53b6dd allow configurable menu font color; from Alexander Polakov with a tweak
from me.

ok oga@
2011-09-08 12:35:33 +00:00
okan
bd65f03126 We are inconsistent when it comes to function returns, so just go all
the way with the cwm specific parts.

ok oga@
2011-07-25 15:10:24 +00:00
okan
24bf547e5f Clarify defines and make them not look like non-local ones; started by a
small diff from Thomas Pfaff.

ok oga@
2011-07-23 13:09:11 +00:00
okan
0fd446f068 add 'normal' cursor and shuffle the others we use to make a bit more
sense and to be slightly less un-expected.  from Alexander Polakov.
re-use 'normal' cursor now instead XC_hand1 for menu selection.  i
really wish X had real docs and made sense.

ok on earlier diff with '?' removed (but it's back now) oga@
2011-06-24 06:52:23 +00:00
okan
5e2c6f5c05 replace the non-working check to see if another wm is running with a
method that actually works.  checking for icccm compliant wm's should
also be done first, but that's another diff (noted by oga).

ok oga@
2011-06-24 05:58:51 +00:00
okan
4fb00eca7b tag and comment cleanup; ok oga@ 2011-05-11 13:53:51 +00:00
oga
c4175c932e grab events on the root window *before* we look for existing windows.
This closes a race we were hitting often where stuff started right
before cwm may not get noticed and not have borders.

ok okan@. Prompted by something todd noticed.
2010-04-12 16:17:46 +00:00
okan
3d3e2130f8 - allow per-screen gap; not (yet) user configurable.
- teach _NET_WORKAREA about gap.

ok oga@
2010-01-27 03:04:50 +00:00
okan
ba93a73ad3 pull all non-X11 headers from calmwm.h and place them only where they
are required.

encourged to go all the way by oga@
2009-12-15 04:10:42 +00:00
okan
0c7627b2f7 pull these headers only into files that need them.
ok oga@
2009-12-15 03:34:34 +00:00