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 [Tue, 26 Jul 2011 13:40:52 +0000 (09:40 -0400)]
Fix blocking in inotify reader.
If the inotify reader reads an event and it ends at the same place the read()
ended, then we don't know that there is anything more available, so don't
try read() again until after it has been poll()'d.
Dana Jansens [Sun, 24 Jul 2011 22:13:36 +0000 (18:13 -0400)]
Make the obt_watch functionality work without inotify (via manual refreshes).
Adds obt/watch_manual.c which is a filler for when watch_inotify.c can't be
used. Other watch_foo.c may also exist in the future I hope.
Adds obt/watch_interface.h which the inotify (and others) subsystem can use
to call back notification to the main watch system that events have
occured.
Keep track of all files being watched within the main watch system, so that if
a directory disappears, we can report the files inside it being removed.
This change moved a lot of the recursive functionality out from
watch_inotify.c into the main watch.c, making it much more simple and should
help make it much easier to add other watch_foo.c subsystems.
Dana Jansens [Wed, 9 Mar 2011 18:49:11 +0000 (13:49 -0500)]
fix updates in the app menu from the linkbase.
it did not remove things correctly if the linkbase removed something while the
menu was not shown.
it sorted the wrong list.
basically it was buggy. tested now with a duplicate .desktop id in 2 places,
and the menu shows only one copy. updating it while the menu is not shown
correctly updates the menu. updating it while the menu is shown also
correclty updates the menu.
Dana Jansens [Wed, 26 Jan 2011 23:11:22 +0000 (18:11 -0500)]
Show the list of categories in the apps menus as submenus.
The categories are not based on what you actually have yet but will be soon.
Removed the "main category" notion from the links themselves, they just
publish a list of categories instead. Moved this notion out to the Apps menu
itself. This should make it easy to possibly to customize your set of
visible categories if we should like to do that sometime.
Dana Jansens [Tue, 25 Jan 2011 18:25:22 +0000 (13:25 -0500)]
don't free lists in the linkbase hash table prematurely.
the values (GSList objects) are freed by the hash table's free function if a
new value is inserted. if we change the list and reinsert it, then it would
cause the list we're inserting to get freed (partially). not good. so instead
we manually free them when we remove them/destroy the hash table.
Dana Jansens [Mon, 24 Jan 2011 22:05:44 +0000 (17:05 -0500)]
Avoid blocks on read() for inotify.
When we come into the function we don't know how much data is available to
read. So just read a single event and return, so poll can figure out if there
is more for us or not.
Dana Jansens [Mon, 24 Jan 2011 20:13:27 +0000 (15:13 -0500)]
Filter links in a ObtLinkbase by environments.
Store a set of active environments in a linkbase and only include links in the
linkbase that 1) want to be displayed, 2) pass TryExec, 3) match environment
requirements and restrictions.
Dana Jansens [Tue, 21 Sep 2010 00:46:37 +0000 (20:46 -0400)]
Linkbase adds all the .desktops in the system, and updates them as they change.
Fixes to .desktop parsing.
Add language/locale support for .desktop files.
Fixes to inotify watching, change what information is passed through the notify handler.
Add linkbase.h to the public obt headers.
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.
Carlos Pita [Wed, 12 Jan 2011 23:49:45 +0000 (20:49 -0300)]
Separate theme options for osd prompt buttons.
I managed to keep backwards compatibility without really cluttering
the code so here is the patch
http://bugzilla.icculus.org/show_bug.cgi?id=4874 too.
Please keep in mind that this is my first piece of code for openbox
and that I'm not a die hard openbox user (yet), not to tell the patch
was not exhaustively tested. Anyway I think it's pretty much in a good
shape but any criticism will be welcome.
Basically the patch add the following theme options for controlling
buttons in osd prompts:
%%%% colors
%
% for the text inside the button
osd.button.unpressed.text.color
osd.button.pressed.text.color
osd.button.focused.text.color
%
% for the line art around the button
% (if you don't wan't the box just make box.color = bg.color)
osd.button.pressed.box.color
osd.button.focused.box.color
unpressed: neither clicked nor selected
focused: selected but not clicked
pressed: clicked (and of course selected)
I discarded the previous distinction between press and pfocus as in
fact it was only a formal distinction, in that both appearances
mimicked each other in every sense. It think that it was just
inherited from the way titlebar buttons are managed so I decided to
simplify it a bit.
All the options default in a way that preserves backwards compatibility:
Notice that a good deal of locs where added to theme.c but in
compensation prompt.c is pretty much simpler now because the
appearances and textures are created while loading the theme.
Mikael Magnusson [Tue, 10 May 2011 14:03:33 +0000 (16:03 +0200)]
Fix menu placement to avoid dead xinerama areas, possibly break other stuff
Use screen_find_monitor(area) instead of screen_find_monitor_point(
topleft corner) in order to find a better monitor when the menu isn't
opening with the mouse cursor in the top left corner.
I made screen_find_monitor return the primary screen when it failed to
find a monitor containing the rect, instead of the total area, no idea
what behaviour this will change but I doubt it will be worse.
Carlos Pita [Wed, 12 Jan 2011 23:49:45 +0000 (20:49 -0300)]
Separate theme options for osd prompt buttons.
I managed to keep backwards compatibility without really cluttering
the code so here is the patch
http://bugzilla.icculus.org/show_bug.cgi?id=4874 too.
Please keep in mind that this is my first piece of code for openbox
and that I'm not a die hard openbox user (yet), not to tell the patch
was not exhaustively tested. Anyway I think it's pretty much in a good
shape but any criticism will be welcome.
Basically the patch add the following theme options for controlling
buttons in osd prompts:
%%%% colors
%
% for the text inside the button
osd.button.unpressed.text.color
osd.button.pressed.text.color
osd.button.focused.text.color
%
% for the line art around the button
% (if you don't wan't the box just make box.color = bg.color)
osd.button.pressed.box.color
osd.button.focused.box.color
unpressed: neither clicked nor selected
focused: selected but not clicked
pressed: clicked (and of course selected)
I discarded the previous distinction between press and pfocus as in
fact it was only a formal distinction, in that both appearances
mimicked each other in every sense. It think that it was just
inherited from the way titlebar buttons are managed so I decided to
simplify it a bit.
All the options default in a way that preserves backwards compatibility:
Notice that a good deal of locs where added to theme.c but in
compensation prompt.c is pretty much simpler now because the
appearances and textures are created while loading the theme.
Dana Jansens [Fri, 13 May 2011 19:48:53 +0000 (15:48 -0400)]
Fix Java apps always appearing on desktop 0.
Fake managing a window doesn't read a requested desktop, but ended up placing
a NET_WM_DESKTOP hint on the window (with value 0). Fake managing doesn't
need to set the DESKTOP hint since the window is not actually being managed,
so remove it from the codepath.
Dana Jansens [Tue, 4 Jan 2011 20:13:07 +0000 (15:13 -0500)]
Resizing removes maximization now, so don't only snap "grow to edge" to screen edges.
This caused a serious annoyance when shrinking a maximized window, it would
shrink to the other end of the monitor, effectively reducing it to its minimum
size.
Dana Jansens [Sat, 16 Oct 2010 21:36:46 +0000 (17:36 -0400)]
when focus=yes in the per-app settings, then the focus request for the new window is from a user. also if allow_other_desktops is false, then always disallow other desktops (Fixes bug #4752)
Dana Jansens [Sat, 16 Oct 2010 21:19:24 +0000 (17:19 -0400)]
Make NET_ACTIVE messages always treated as from the user. Loosen up focus stealing for user-requested focusing.
Seems panels such as xfce's and gnome's still treat their activation requests
as being from an application when a user has requested it.
Make the focus stealing code more lenient for user-requested focusings
(_NET_ACTIVE). But treat new windows as not user-requested unless they
gave a launch time.
When activating a window, if another window would be the one to actually get
focused, then activate that instead (avoid clicking a window in the panel and
nothing happens).
Dana Jansens [Fri, 15 Oct 2010 19:06:16 +0000 (15:06 -0400)]
if no launch time is provided for an application, make one up.
if the window is related to other existing windows
and one of those windows was the last used
then we will give it a launch time equal to the last user time,
which will end up giving the window focus probably.
else
the window is related to other windows, but you are not working in them?
seems suspicious, so we will give it a launch time of NOW - STEAL_INTERVAL,
so it will be given focus only if we didn't use something else during the
steal interval.
else
the window is all on its own, so we can't judge it. give it a launch time
equal to the last user time, so it will probably take focus.
this way running things from a terminal will give them focus, but popups
without a launch time shouldn't steal focus so easily.
Dana Jansens [Thu, 14 Oct 2010 23:40:41 +0000 (19:40 -0400)]
Big changes to placement across multiple monitors.
Add a Primary option for which monitor to place new windows on. Make "Active" the default instead of "Any", which is just totally crazy.
When a window is being placed in the FOREGROUND, use a monitor chosen in
the following order:
1. same monitor as parent
2. primary monitor if placement=PRIMARY
active monitor if placement=ACTIVE
pointer monitor if placement=MOUSE
3. primary monitor
4. other monitors where the window has group members on the same desktop
5. other monitors where the window has group members on other desktops
6. other monitors
When a window is being placed in the BACKGROUND, use a monitor chosen in the
following order:
1. same monitor as parent
2. other monitors where the window has group members on the same desktop
2a. primary monitor in this set
2b. other monitors in this set
3. other monitors where the window has group members on other desktops
3a. primary monitor in this set
3b. other monitors in this set
4. other monitors
4a. primary monitor in this set
4b. other monitors in this set
Decide to focus the new window before placing it, so we know if it will be
placed in the foreground or background.
Always choose a single monitor, then place on it, rather than possibly moving
to a "backup" monitor. Unpredictable monitor placement is horrible.
Dana Jansens [Thu, 14 Oct 2010 23:39:34 +0000 (19:39 -0400)]
add function screen_compare_desktops()
tells if two windows' current desktops are considered logically on the same
desktop (taking "all desktops" into account)
if a window is on "all desktops" it is considered to be on the current desktop
only - windows can only be in one place at a time.
Dana Jansens [Wed, 29 Sep 2010 20:04:53 +0000 (16:04 -0400)]
update the user-interaction timestamp when running a (non-interactive) action on the focused window
update it at the end of running actions instead of multiple times (once for
each action)