Skip to content

Commit

Permalink
Added optimization to drag of shaped windows where xor of dimensions …
Browse files Browse the repository at this point in the history
…of shaped

windows is taken to determine delta of size in further determination of
whether or not to call jbwm_set_shape().  Such is still called frequently on
shaped window resize however.  This required adding field szsum to
JBWMClient.h.
  • Loading branch information
alisabedard committed Jul 16, 2017
1 parent ad01b5f commit 6b3d3a4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion JBWMClient.h
Expand Up @@ -17,9 +17,10 @@ struct JBWMClient {
Window window, parent;
struct JBWMClientOptions opt;
struct JBWMRectangle size, old_size, before_fullscreen;
uint16_t szsum; // used to check size changes for shape setting
uint8_t screen;
uint8_t vdesk;
int8_t ignore_unmap;
int8_t __pad[3];
int8_t __pad[1];
};
#endif /* JBWM_CLIENT_STRUCT_H */
8 changes: 5 additions & 3 deletions ewmh.c
Expand Up @@ -73,9 +73,11 @@ static int get_client_list_r(Window ** list, Display * d,
#ifdef DEBUG
static void debug_window_list(int n, Window * window_list)
{
JBWM_LOG("get_*_client_list(n is %d", n);
while (--n >= 0)
JBWM_LOG("\t[n is %d] window %d", n, (int)window_list[n]);
if (n >= 0) {
JBWM_LOG("window_list[%d] is 0x%x",
n, (int)window_list[n]);
debug_window_list(n - 1, window_list);
}
}
#else//!DEBUG
#define debug_window_list(n, w)
Expand Down
4 changes: 2 additions & 2 deletions ewmh.scm
Expand Up @@ -33,8 +33,8 @@
(begin-array-definition "char *" "jbwm_atom_names" outf)
(print-all print-each-array-element outf)
(end-c-definition outf)
(display (string-append "\tXInternAtoms(d, jbwm_atom_names,"
" JBWM_EWMH_ATOMS_COUNT,\n\t\tfalse, jbwm_ewmh);\n}") outf)
(display "\tXInternAtoms(d, jbwm_atom_names, " outf)
(display "JBWM_EWMH_ATOMS_COUNT,\n\t\tfalse, jbwm_ewmh);\n}\n") outf)
(close-port outf))))
; Generate "ewmh_allowed.c"
(write-jbwm-ewmh-allowed-c
Expand Down
9 changes: 7 additions & 2 deletions move_resize.c
Expand Up @@ -39,8 +39,13 @@ void jbwm_move_resize(struct JBWMClient * restrict c)
jbwm_handle_mwm_hints(c);
jbwm_update_title_bar(c);
} // Skip shaped and fullscreen clients.
do_move(c->display, c->parent, c->window, &c->size, offset);
jbwm_set_shape(c);
struct JBWMRectangle * restrict s = &c->size;
do_move(c->display, c->parent, c->window, s, offset);
uint16_t szsum = s->width ^ s->height;
if (szsum != c->szsum) {
c->szsum = szsum;
jbwm_set_shape(c);
}
jbwm_configure_client(c);
}

0 comments on commit 6b3d3a4

Please sign in to comment.