1
0
Fork 0

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> 2002-09-27 Havoc Pennington <hp@pobox.com>
* src/stack.c (get_standalone_layer): Temporarily disable use of * 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" #include "screen.h"
/* Type of last-queued stacking operation, hung off of MetaWindow /* Layers vs. stack positions
* but an opaque type used only in stack.c * ==========================
*
* 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 */ /* These MUST be in the order of stacking */
typedef enum typedef enum
@ -47,25 +61,30 @@ struct _MetaStack
{ {
MetaScreen *screen; MetaScreen *screen;
/* All windows that we manage, in mapping order, /* All X windows that we manage, in mapping order,
* for _NET_CLIENT_LIST * for _NET_CLIENT_LIST
*/ */
GArray *windows; GArray *windows;
/* List of MetaWindow* in each layer */ /* Currently-stacked MetaWindow */
GList *layers[META_LAYER_LAST]; GList *sorted;
/* MetaWindow to be added to the sorted list */
/* List of MetaStackOp, most recent op GList *added;
* first in list. /* Window IDs to be removed from the stack */
*/ GList *removed;
GList *pending;
int freeze_count; int freeze_count;
int n_added;
/* The last-known stack */ /* The last-known stack */
GArray *last_root_children_stacked; 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); MetaStack *meta_stack_new (MetaScreen *screen);
@ -111,6 +130,9 @@ int meta_stack_windows_cmp (MetaStack *stack,
MetaWindow *window_a, MetaWindow *window_a,
MetaWindow *window_b); MetaWindow *window_b);
void meta_window_set_stack_position (MetaWindow *window,
int position);
#endif #endif

View file

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

View file

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