Commit graph

7464 commits

Author SHA1 Message Date
Mikael Magnusson
ef868caf4c Fix a typo that prevented setting client size for the height only (???) 2013-08-11 02:07:32 +02:00
Mikael Magnusson
21349b6046 Convert two // to /* 2013-08-11 02:03:23 +02:00
Mikael Magnusson
1b73a29646 Constrain the moveresize popup to the monitor which has the client 2013-06-07 08:40:52 +02:00
Mikael Magnusson
8be9cc92b6 Rename bounds to monitor in place_overlap and move a const 2013-06-07 08:40:52 +02:00
Mikael Magnusson
e6a5acaf1b Fix least overlap to fall back to the chosen monitor, not (0,0). 2013-04-23 21:36:03 +02:00
Mikael Magnusson
53b8c86a60 We forgot to count the dock in LeastOverlap 2013-04-23 21:36:03 +02:00
Mikael Magnusson
f6fb70a4b9 Remove some evil tabs 2013-04-17 13:23:19 +02:00
Dana Jansens
782b2864b1 Refactor the per-app parsing code into a helper function and reduce nesting by 2 levels 2012-10-06 23:07:09 -04:00
Dana Jansens
71ffb4375d Make MoveResizeTo work on the dimensions of the frame, not the client 2012-10-06 23:05:50 -04:00
Dana Jansens
10a833b2cb Allow application rules to control window size (Fix bug 4661)
Use the following in your per-app rules:

<size>
  <width>A</width>
  <height>B</height>
</size>

A and B can be integer values to specify a size in pixels. They can also be
percentages or fractions to be relative to the size of the monitor the window
is placed on.
2012-10-06 23:04:57 -04:00
Dana Jansens
5e282dae08 Remove now-unused config_place_center option.
The new LeastOverlap placement doesn't use this option, and it kind of defeats
the purpose of the algorithm.
2012-10-06 22:52:31 -04:00
Dana Jansens
8a26a5190c When an undecorated window is maximized give it a 1px border at the top (Fix bug 5506)
We want to keep some way for a user to re-decorate the window with the default
bindings. However with a large border width, the top border is much bigger than
it needs to be! So make it fixed at 1px large in this case.
2012-10-06 22:47:46 -04:00
Dana Jansens
1869e4e830 Allow non-interactive focus cycling.
Adds an <interactive>bool</interactive> option to the NextWindow and
PreviousWindow actions. When it is false, the action is not interactive and will
immediately switch focus to whatever the next focus target is.

Removing the "interactive" flag from the focus_cycle() method, as it was unused
previously, and the new code does not make use of it either. In order to be
non-interactive it simply starts a focus_cycle then immediately ends it when the
action ends.

The "interactive" flag in focus_cycle() forced a linear cycling order which may
not be what you want, so the new method is preferrable anyhow.
2012-10-06 22:30:02 -04:00
Dana Jansens
d0ba880668 Don't let autostart checking for background-setting tools end up in logs (Fix bug 5186) 2012-10-06 22:30:02 -04:00
Dana Jansens
d3a8bab0f0 Add a $pointer execute variable substitution and make $wip and $pid consistent (Fix bug 5758)
$wip and $pid would output values for the current target window if there was
one, but output nothing at all if there wasn't making the output difficult to
parse. Changed to make these always output a 0 if there is no target.

Added a $pointer variable that is replaced with the x and y coordiates of the
pointer, separated by a space.

Inspired by the work of Denis Kaganovich <mahatma@eu.by>.
2012-10-06 22:30:02 -04:00
Dana Jansens
aa36b603d7 Remove unused variable 2012-10-06 22:30:02 -04:00
Dana Jansens
01570a6a82 Fix duplicate const warning 2012-10-06 22:30:02 -04:00
Denis Kaganovich
1974c69fb3 Fix some namings and xml formatting in rc.xml and rc.xsd 2012-10-06 22:30:02 -04:00
Dana Jansens
56a0993300 When a window is the focus target and it is removed from the focus order, reset the focus cycling (Fix bug 5410)
We were only doing this if a dialog was showing. But if it's the target, then
a dialog is not relevant, we should always recompute the focus cycling. This
avoids a crash when not using a dialog and closing a window during cycling.
2012-10-06 22:30:02 -04:00
Dana Jansens
2391410e3f Fix negative ResizeRelative values with terminal windows (Fix bug 5228)
Inspired by patches from Brian Mock <mock.brian@gmail.com>.
2012-10-06 22:12:22 -04:00
Dana Jansens
62fd771d2f Get the window's title in the fake-managed case since we apply app rule matching (Fix bug 5277) 2012-10-06 21:56:57 -04:00
Xin Wang
c6997ba19e Print error message to stderr (Fix bug 5731)
As stdout is redirected to /dev/null by some DMs, we need to print error
messages to stderr.
2012-10-06 21:56:57 -04:00
Denis Kaganovich
65693d18db Address a couple bugs in rc.xsd (Fix bug 5746) 2012-10-06 21:56:57 -04:00
Julian Ospald
9154bddf35 Make .desktop files obey specs where possible (Fix bug 5737) 2012-10-06 21:56:56 -04:00
Dana Jansens
af01da3150 Allow windows created by execute actions to steal focus if the user isn't interacting with another window (Fix bug 5419).
When the execute action was run, we would say that the user had used the focused
at that time. Then when a new window popped up, we'd think the user was busy in
the current window and prevent the new one from steal focus.

Now the execute action does not update the "user interacted with the focused
window" timestamp anymore. So, if they aren't currently typing in some window
when they trigger an execute action, and the window appears, it will steal
focus.
2012-10-06 21:56:56 -04:00
Dana Jansens
6eb740cf11 Allow window matching based on the group leader's name and class (Fix bug 5721)
In Openbox 3.4 we used the group leader's WM_CLASS value when it was available.
This prevents windows in the group from overriding with a specific value,
however which is bad. More rationale can be found in
http://icculus.org/pipermail/openbox/2010-September/006790.html

Some applications (eg. Firefox) use command line flags to set the WM_CLASS
property on the group leader but do not change the property on the mapped
windows themselves. This makes matching these windows not possible in Openbox
3.5.

We resolve this by exposing the group's WM_CLASS values alongside the individual
window's values. We add _OB_APP_GROUP_NAME and _OB_APP_GROUP_CLASS properties
along with "groupname" and "classname" attributes for the rc.xml application
tag.
2012-10-06 21:56:56 -04:00
Dana Jansens
51d735672c 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.
2012-10-06 21:56:56 -04:00
Dana Jansens
dc4cfa94c9 Make LeastOverlap placment replace the behaviour of Smart and address style nits 2012-10-06 21:56:56 -04:00
Ian Zimmerman
4d2ccf1916 LeastOverlap placement option (Fix bug 5385)
Adds a new placement algorithm that finds a place on the monitor that overlaps
the least amount of windows as possible.

Original patch by Ian Zimmerman <itz@buug.org>.
Port to Openbox 3.5 by David Vogt <dv@adfinis.c>.
2012-10-06 21:56:56 -04:00
Dana Jansens
01f62ded2f 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.
2012-10-06 21:56:56 -04:00
Dana Jansens
9a5160b88b Don't edge-warp with the cursor based on a monitor that does not contain the pointer (Fix bug 4992) 2012-10-06 21:56:56 -04:00
Dana Jansens
d68116c9c9 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.
2012-10-06 21:56:56 -04:00
Hanno Meyer-Thurow
dc69fe7ced Theme button-specific values should fallback to the button general values consistently (Fix bug 5443) 2012-09-30 18:46:10 -04:00
Dana Jansens
29b735d8a9 Prompt should not always use the currently focused button as its result (Fix bug 5518) 2012-09-30 18:09:37 -04:00
John Vogel
c94992179e Update manpage to current version. (Fix bug 5444) 2012-09-30 17:59:59 -04:00
Dana Jansens
dff5276482 Don't strip leading whitespace from menu labels (Fix bug 4782) 2012-09-30 15:53:35 -04:00
Dana Jansens
3aee1ac3a1 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
2012-09-30 15:24:50 -04:00
Dana Jansens
52cdea653c Allow client destroy notify functions to be removed based on the data associated with them. 2012-09-30 15:23:14 -04:00
Dana Jansens
34b332c22a Fix prompt cleanup (was not going through the list correctly when freeing items) 2012-09-30 15:03:07 -04:00
Dana Jansens
efc9d9708e Select the menu item under the mouse when the mouse is moved (Fix bug 5237) 2012-09-30 15:00:14 -04:00
Dana Jansens
8f988b2bef Make ResizeRelative resize in terms of pixels for windows with resize increments (Fix bug 5228)
If the resize is less than the window's resize increment then we bump it up
to ensure a resize does at least happen.
2012-09-30 14:58:36 -04:00
Dana Jansens
9415459aea Make the inactive osd text color fall back to the old osd property, and lastly inherit from the unfocused window color. 2012-09-30 14:58:11 -04:00
Dana Jansens
d58ed5c413 Allow an xml tag to be unregistered from the xml parser. 2012-09-30 14:57:41 -04:00
Dana Jansens
69672e9d07 Properly build path names for obt_paths_try_exec 2012-09-30 14:57:24 -04:00
Dana Jansens
9f31f80ce8 add menu_sort_entries() which sorts all entries in an ObMenu
this function sorts each group of entries that appear together between two
consecutive separators (or ends of the list)
2012-09-30 14:50:30 -04:00
Dana Jansens
7d32190a4c Add another BSEARCH function that lets you search through an array of objects.
If you give it a value x, the macro lets you pull a value out of each object
that you want to compare to x.
2012-09-30 14:50:30 -04:00
Dana Jansens
30fe9697df skip empty strings when splitting paths in the environment 2012-09-30 14:50:30 -04:00
Dana Jansens
5ced1a06fc hide the menus before shutting them down on reconfigure 2012-09-30 14:50:30 -04:00
Dana Jansens
f53fa1e589 Fix for when the menu's update function returns FALSE and no menu is shown.
The ObMenuFrame was not being freed, and the child pointer was being left
pointing to the frame that was not visible.
2012-09-30 14:50:30 -04:00
Dana Jansens
fbc3e344cd Just put copyright starting year in README so we don't need to keep updating it. Make --version match README. 2012-09-30 14:50:21 -04:00