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)
Dana Jansens [Tue, 21 Sep 2010 18:23:57 +0000 (14:23 -0400)]
Big rework of image.c and the image cache system.
Added a lot of comments, simplified call graphs.
Added full (not second-class) support for images coming from named sources (files, icon themes).
RrImage holds an RrImageSet. RrImageSet holds a bunch of RrImagePic, which are different sizes of a logical image.
RrImageSet objects can be merged if it is discovered they (will) share an RrImagePic. The RrImage objects are updated to use the new merged RrImageSet.
Dana Jansens [Mon, 14 Jun 2010 16:15:02 +0000 (12:15 -0400)]
Fix the EXTENTS reported on window frames.
Change the order things are done on map, so we apply startup state without
any states set first, thus getting all the functions possible for the window
type etc. then change the order states are applied, as some remove the
ability to apply others (ie fullscreen comes last).
Add an oldsize to ObFrame that remembers the size of the frame last reported to
the world through the EXTENTS property. If you frame_adjust_area(FAKE) then
frame_adjust_area(NONFAKE), the EXTENTS would not be updated since the
oldsize wasn't remembered across fake updates.
Make the extentsrequest test ask about windows with states set also.
Dana Jansens [Thu, 3 Jun 2010 16:10:54 +0000 (12:10 -0400)]
improved .desktop parsing.
properly (and quickly) check for existence of required keys
figure out what an app can open from its exec key
validate the %fields in an app's exec key
Dana Jansens [Fri, 21 May 2010 20:51:45 +0000 (16:51 -0400)]
allow new windows on other desktops to get focused if specified in a per-app rule
you can not client_active() with user=false and desktop=true and activate things on other desktops, by the general focus steal restrictions, if you wanted to do that sorta thing
Dana Jansens [Tue, 18 May 2010 22:47:54 +0000 (18:47 -0400)]
allows a window to unmax by resizing.
makes "clever" use of the client's pre_max_area values to allow this to happen
without flashing, and preserving them in case the user cancels the resize
after it has become unmaximized.
Dana Jansens [Tue, 18 May 2010 01:58:44 +0000 (21:58 -0400)]
set the interactive action to NULL before doing its cleanup phase
if the cleanup ends up cancelling the "current interactive action", it would
cause the end function to be called again, which sucks. for instance if the
cleanup function uses the Focus action. this prevents the unwanted loop
into the interactive action cleanup.
Mikael Magnusson [Fri, 16 Apr 2010 16:04:24 +0000 (18:04 +0200)]
Add support for using relative expressions in move and resize actions
Have MoveResizeTo use config_parse_gravity_coord instead of duplicating it locally
Allow MoveResizeTo positions and sizes and per app positions to be relative to screen size
Rename to config_parse_relative_number so it can be used for sizes too
Add relative numbers to width/height in MoveResizeTo
Add relative numbers to MoveRelative
Add relative numbers to ResizeRelative, these are for the client size, not screen size
Dana Jansens [Tue, 11 May 2010 23:01:46 +0000 (19:01 -0400)]
add cleanup functions to the client list menus that removes everything from them when they are not being shown (saves iterating thru the list uselessly when a client is unmanaged)
Dana Jansens [Tue, 27 Apr 2010 22:45:22 +0000 (18:45 -0400)]
fix XSYNCronization of resizes (especially with two monitors).
1) a ConfigureNotify must always follow a Sync notification
2) determine the final size of the window with its position else struts are not applied properly for (partly) maximized windows
3) set the sync counter to a value when managing a new window
Dana Jansens [Tue, 27 Apr 2010 21:24:51 +0000 (17:24 -0400)]
make sure clients stay on screen when the root window changes size, and maximized/fullscreen windows must be on some monitor or it doesn't make much sense (and asserts)
Dana Jansens [Fri, 23 Apr 2010 15:54:09 +0000 (11:54 -0400)]
putting events on the event queue does not send them back to the server. it was just going to get ignored the next time around cuz the window wouldnt be in our list of clients
Dana Jansens [Sat, 17 Apr 2010 02:23:37 +0000 (22:23 -0400)]
event_curtime is replaced (publicly) by event_time()
This function never returns CurrentTime, which is nice, cuz using CurrentTime for XSetFocus always sucks.
If the current XEvent did not have a timestamp, then event_time() will find one. It finds the first timestamp available in the X event queue, meaning the earliest timestamp >= the current (nontimestamped) event. All future events should have a timestamp >= event_time(), so using this in XSetFocus() should not mess up any future calls we make to it.
This change seems to work well, as it appears to fix bug #3648.