Dana Jansens [Mon, 20 Sep 2010 19:45:36 +0000 (15:45 -0400)]
Add/fix inotify support for watching filesystem changes.
obt/watch.h has the interface.
obt/watch.c has the generic watch code.
obt/watch_inotify.c has an inotify-specific backend, which could be replaced with another.
Dana Jansens [Sat, 15 Oct 2011 19:11:56 +0000 (15:11 -0400)]
Fix error printing when parsing and save the last error.
Errors would have a line number relative to the string of text being parsed,
but if this is in a larger file, then it's useless. So add a callback that
can modify the line number for parsing things nested in a larger document.
This gives proper errors for parsing actions in the xml config files.
Also, change how errors are given back when creating a new action. Instead of
printing it directly, return an error string so the parser can show what line
the invalid action was found on.
Dana Jansens [Fri, 14 Oct 2011 23:53:06 +0000 (19:53 -0400)]
Add an action for toggling debug output.
- Rename "Debug" action to "Print" for displaying text.
- Add "Debug" action that sets/toggles showing debug messages. It has the
standard set:<foo> argument where <foo> is on/off/toggle.
Dana Jansens [Fri, 5 Aug 2011 15:35:09 +0000 (11:35 -0400)]
Rename ObActionValue to ObConfigValue. This holds one of three types.
1. A string
2. A list of other ObConfigValues
3. A list of actions (ObActionList).
The string type can be returned in various ways such as int, enum, fraction, gravity coordiate.
Provide a ways to save the ObConfigValue into a pointer. This lets you keep
the value contained withing the ObConfigValue in a variable of its basic type.
Dana Jansens [Wed, 3 Aug 2011 21:03:30 +0000 (17:03 -0400)]
register filters on startup
TODO:
1. write filters for everything in actions/if.c
2. rm actions/if.c
3. make action(s) to change config options?
includes key and mouse binding
4. rm -rf *xml*?
Dana Jansens [Wed, 3 Aug 2011 15:32:02 +0000 (11:32 -0400)]
Add functions to ObClientSet to run a function on each client in the set, and add constness.
Anything that doesnt change/destroy the given set takes a const ObClientSet*.
Dana Jansens [Tue, 2 Aug 2011 19:55:44 +0000 (15:55 -0400)]
Add action_list_run.c/h with action_list_run() and struct ObActionListRun.
This function runs an action list, taking over from the function that used to
live in action.c. Now the action.c function will simply run a single action.
The actions and filters now take a const ObActionListRun* which describes
the user event which triggered the actions/filters to run.
The action_list_run() function can also run filters, yay. However...
TODO:
1. the filters' client sets are not passed to actions yet. do this.
2. make action(s) to change config options
includes key and mouse binding
3. rm -rf *xml*
Dana Jansens [Tue, 2 Aug 2011 18:45:21 +0000 (14:45 -0400)]
Add a means to duplicate ObClientSet
and fix destroy notifications.
- set the destroy notification when making a set with a single window, not
when making an empty set.
- always add/remove the destroy notification when creating/destroying the hash
table
Dana Jansens [Fri, 29 Jul 2011 21:28:14 +0000 (17:28 -0400)]
make a special "ALL" ObClientSet which contains all clients.
This saves copying all the clients into the set.
IMPORTANT: This client set will test as a "true" boolean regardless of if there
are clients present or not.
- We did this to allow for boolean filters. A boolean filter returns the
"ALL" set for its true value, and an empty set for its false value.
Dana Jansens [Fri, 29 Jul 2011 20:57:55 +0000 (16:57 -0400)]
Pass a user data to the client_set_reduce/expand function which is given to the
callback.
This lets us pass the filter's context in to its test function along with the
client window, so it can make an intelligent decision about adding/removing
the client from the current set.
Dana Jansens [Fri, 29 Jul 2011 20:00:02 +0000 (16:00 -0400)]
Add ObClientSet data type. It holds a set of clients !
The sets can be modified by union and intersection, and can have clients
added or removed with a test callback function.
They use a GHashTable underneath.
Dana Jansens [Wed, 27 Jul 2011 20:32:05 +0000 (16:32 -0400)]
Parse ObActionsList*s from the config file (out of the xml for now).
- config.c: use the new actions parser
- actions.c: provide the actions parser a way to create a new action (takes
a hash table of options for it)
- actions/*.c: take a hash table of options instead of an xml subtree
- *: us ObActionsList* instead of a GList* of ObActionAct*s.
TODO:
1. make filters
openbox/filters/*.c
openbox/filters.c as interface to them
store filters in parsed filter tests instead of key/value pairs
2. make action(s) to change config options
includes key and mouse binding
3. rm -rf *xml*
Dana Jansens [Tue, 26 Jul 2011 22:06:42 +0000 (18:06 -0400)]
Add a parser for the action command language.
The parser generates list of actions (complete with filters). The parser isn't
called anywhere yet, and uses the incomplete actions_act_new() function.
TODO:
The filters now are just text string key:value pairs. But they should
become intelligent objects like actions are.
The actions need to change their option parsing from XML to the new key:value
pair lists.
Dana Jansens [Sun, 16 Oct 2011 15:50:15 +0000 (11:50 -0400)]
Use the KeyCode to directly find the modifier mask. (bug #5173)
We were finding the KeySym first, and then converting back to a modifier mask.
But KeySym on a key's release can differ from on its press, and we don't need
them to determine the modmask from the keycode.
[setxkbmap -option "grp:shifts_toggle"] turns Shift_L into XK_ISO_Prev_Group on
key release, and Shift_R into XK_ISO_Next_Group.
Dana Jansens [Sun, 16 Oct 2011 15:10:14 +0000 (11:10 -0400)]
Don't make desktop switching interactive when no mods used. (bug #5203)
Make mod state passing more consistent, and always give actions the full state
instead of stripping sometimes. (They ended up expecting it stripped always).
Dana Jansens [Sun, 16 Oct 2011 03:04:21 +0000 (23:04 -0400)]
Pick the monitor most relevant to a rectangle more cleverly.
When monitors overlap (this happens with cloning), we were choosing a monitor
to associate with a window, for maximization for example, somewhat arbitrarily.
Now we have a more clever algorithm that considers the configured primary
monitor first, and that does not prefer monitors based on their sizes, but only
only how much of the window is in the monitor, excluding parts that were claimed
by another monitor already.
Dana Jansens [Mon, 4 Oct 2010 18:33:16 +0000 (14:33 -0400)]
Create some Openbox release scripts:
release/bugs: Prints a list of bugs that are mentioned in git commits for a
git revision, since previous release.
- Very useful for updating the CHANGELOG file!
release/go: Tests a git revision for correct compilation, and prepares files
for release.
- Makes the tarball
- Makes a GPG signature for the tarball
- Tags the release
- Spits out URLs to edit and gives the changelog for copy/paste.
release/email: Sends an email to the Openbox mailing list with the changelog
and details about the release. Call this with the same parameters used for
running release/go once it is finished, and the files are uploaded, etc.
- Also emails mikachu re freshmeat.net
Dana Jansens [Sat, 15 Oct 2011 19:07:59 +0000 (15:07 -0400)]
Fixes for gnome-session 3.
We run by default with a panel (default gnome-panel) and then run Openbox
without any panel if one cannot be found.
- Adds a fallback session for if a panel (default gnome-panel) not found.
- Removes notifications as a requirement. Seems to be a legacy thing judging
from the ubuntu .session files. Notifications are being provided by
notify-osd on modern systems, and you can't check for its presence in
gnome-session (gnome-classic.session always fails because it looks for it, so
ubuntu falls back to gnome-fallback.session).
Dana Jansens [Fri, 14 Oct 2011 22:54:32 +0000 (18:54 -0400)]
make undecorated windows place according to their undecorated state (bug #5179)
splits client_setup_decor_and_functions() into 3 functions.
1. add client_setup_default_decor_and_functions()
- called from client_get_all() to get the maximum decor/functions that will
be available for use by the client.
2. add client_setup_decor_undecorated()
- sets up the client's undecorarted decor if the flag is set by the per-app
settings or session state.
- we do this before setting up the frame so the frame reflects the window as it
should be when getting placed.
3. client_setup_decor_and_functions()
- calls the above 2 to perform the same functions as before.
- added to client_apply_startup_state() so that we can ensure it was run fully
at least once in the mapping process, since it is not called in
client_get_all() anymore.
Dana Jansens [Fri, 14 Oct 2011 22:52:36 +0000 (18:52 -0400)]
it would seem this cannot return NULL now
It will get the primary monitor if there is not monitor under the pointer. But
assert so it's clear something went wrong if this does happen. Note that there
was previously no check for the return value even though the comment claimed
there should be.
Change default doubleclick timeout to 500ms and keep track of where last click was
Bug #5152 - "mouse double-click time is too low by default - 200ms"
We only use the doubleclick in one place in the default configuration,
for doubleclicking titlebars to maximize windows, so any negative impact
of increasing the timeout should be minimal, especially with the
addition of requiring the two clicks to be in the same place.
Doubleclicks are hardcoded to occur within 8 pixels for now, it doesn't
seem worth it to add a config until someone complains. A possibility is
using the drag threshold, but some people have that set very low so it
could be hard to doubleclick then.
Dana Jansens [Thu, 6 Oct 2011 14:03:52 +0000 (10:03 -0400)]
Don't show prompts inside the message handler to prevent recursion
Showing prompts causes messages to be created which causes the glib message
handler to abort(). Save the messages and show them when done all other
processing for the current event.