Rewrite stack code to work a lot differently. Should be better now, and

2002-09-28  Havoc Pennington  <hp@pobox.com>

	* src/window.c, src/stack.c: Rewrite stack code to work a lot
	differently. Should be better now, and not lose relative positions
	of windows when moving among layers. Also should now be possible
	to get session management to restore the stacking order.  Probably
	breaks some stuff, and makes all the stack.c changes I made
	yesterday sort of irrelevant.
This commit is contained in:
Havoc Pennington 2002-09-28 16:33:39 +00:00 committed by Havoc Pennington
parent 2926f0a501
commit e96e7ffc89
5 changed files with 514 additions and 619 deletions

View File

@ -1,3 +1,12 @@
2002-09-28 Havoc Pennington <hp@pobox.com>
* src/window.c, src/stack.c: Rewrite stack code to work a lot
differently. Should be better now, and not lose relative positions
of windows when moving among layers. Also should now be possible
to get session management to restore the stacking order. Probably
breaks some stuff, and makes all the stack.c changes I made
yesterday sort of irrelevant.
2002-09-27 Havoc Pennington <hp@pobox.com>
* src/stack.c (get_standalone_layer): Temporarily disable use of

File diff suppressed because it is too large Load Diff

View File

@ -24,10 +24,24 @@
#include "screen.h"
/* Type of last-queued stacking operation, hung off of MetaWindow
* but an opaque type used only in stack.c
/* Layers vs. stack positions
* ==========================
*
* There are two factors that determine window position.
*
* One is window->stack_position, which is a unique integer
* indicating how windows are ordered with respect to one
* another. The ordering here transcends layers; it isn't changed
* as the window is moved among layers. This allows us to move several
* windows from one layer to another, while preserving the relative
* order of the moved windows. Also, it allows us to restore
* the stacking order from a saved session.
*
* However when actually stacking windows on the screen, the
* layer overrides the stack_position; windows are first sorted
* by layer, then by stack_position within each layer.
*
*/
typedef struct _MetaStackOp MetaStackOp;
/* These MUST be in the order of stacking */
typedef enum
@ -47,25 +61,30 @@ struct _MetaStack
{
MetaScreen *screen;
/* All windows that we manage, in mapping order,
/* All X windows that we manage, in mapping order,
* for _NET_CLIENT_LIST
*/
GArray *windows;
/* List of MetaWindow* in each layer */
GList *layers[META_LAYER_LAST];
/* List of MetaStackOp, most recent op
* first in list.
*/
GList *pending;
/* Currently-stacked MetaWindow */
GList *sorted;
/* MetaWindow to be added to the sorted list */
GList *added;
/* Window IDs to be removed from the stack */
GList *removed;
int freeze_count;
int n_added;
/* The last-known stack */
GArray *last_root_children_stacked;
/* number of stack positions */
int n_positions;
/* What needs doing */
unsigned int need_resort : 1;
unsigned int need_relayer : 1;
unsigned int need_constrain : 1;
};
MetaStack *meta_stack_new (MetaScreen *screen);
@ -111,6 +130,9 @@ int meta_stack_windows_cmp (MetaStack *stack,
MetaWindow *window_a,
MetaWindow *window_b);
void meta_window_set_stack_position (MetaWindow *window,
int position);
#endif

View File

@ -415,8 +415,8 @@ meta_window_new (MetaDisplay *display, Window xwindow,
window->cached_group = NULL;
window->layer = META_LAYER_NORMAL;
window->stack_op = NULL;
window->layer = META_LAYER_LAST; /* invalid value */
window->stack_position = -1;
window->initial_workspace = 0; /* not used */
meta_display_register_x_window (display, &window->xwindow, window);

View File

@ -252,8 +252,8 @@ struct _MetaWindow
/* Managed by stack.c */
MetaStackLayer layer;
MetaStackOp *stack_op;
int stack_position; /* see comment in stack.h */
/* Current dialog open for this window */
int dialog_pid;
int dialog_pipe;