Dana Jansens [Mon, 1 Oct 2012 01:23:58 +0000 (21:23 -0400)]
Allow loading of menu files outside of your XDG_CONFIG_HOME (Fix bug 5711)
When the given file name can not be found in your XDG_CONFIG_HOME, ie in
~/.config/openbox, then try the file name directly.
This means if you specify a menu file such as "/home/dana/helloworld.xml",
openbox will try, in order:
1) ~/.config/openbox/home/dana/helloworld.xml
2) /home/dana/helloworld.xml
And it will load the file you meant when it tries the second one.
Dana Jansens [Mon, 1 Oct 2012 00:29:45 +0000 (20:29 -0400)]
Use the nearest monitor when the search query rect does not intersect any monitor (Fix bug 5500)
Previously we would try to find the primary monitor and use that when the search
was outside any monitor. However, if the primary monitor is chosen by the mouse
position and the mouse is not inside any monitor, we enter infinite recursion
trying to find the primary monitor.
The nearest monitor is a better metric anyhow, and this ensures
screen_find_monitor() is never recursive as it always returns a value without
depending on other screen.c methods.
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
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 [Sun, 16 Oct 2011 15:50:15 +0000 (11:50 -0400)]
Use the KeyCode to directly find the modifier mask. (Fix 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. (Fix 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 [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.
Dana Jansens [Wed, 5 Oct 2011 17:25:46 +0000 (13:25 -0400)]
Consistency with helper/modal windows and multiple desktops.
When focusing a window, bring its helper windows. This happened before when
switching its desktop, but if you have 2 windows on different desktops and
switch between them, the helpers should come to both when they are being used.
When a new helper/modal window maps on a different desktop and you are using
the application, then the helper/modal window is moved to the current desktop
to be with the application you are using.
Dana Jansens [Tue, 4 Oct 2011 21:53:54 +0000 (17:53 -0400)]
Fix focus stealing for changing desktops/Use timestamp for user input events
Change the logic for when to allow stealing focus across desktops.
- It was possible to call event_time_after() with a CurrentTime in the old code.
- It would disallow a user requested change which is crazy.
- It would change desktops on you when a new window appeared but this is
generally not desirable.
event_source_time() is supposed to give the time which the user made things
happen. we leave it at 0 for user-input events right now which means stuff like
changing desktop doesn't save any timestamp at all. we should use the
timestamp from x for user-generated events.
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.