Alopex

Check-in [4575c6d08f]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixed typo in configurerequest which lead to incorrect window sizes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | master
Files: files | file ages | folders
SHA3-256:4575c6d08fdfe4083329ff1786dd9b8db4772b5e6956ee0937c920020d672bce
User & Date: jesse@mccluresk9.com 2014-03-29 18:45:54
Context
2014-03-31
18:19
fixed get_size use of min_(width_height) check-in: c0309f8da5 user: jesse@mccluresk9.com tags: trunk, master
2014-03-29
18:45
fixed typo in configurerequest which lead to incorrect window sizes check-in: 4575c6d08f user: jesse@mccluresk9.com tags: trunk, master
2014-03-26
02:55
gtk3 fix + clear rootwin name after reading check-in: 321eb79d01 user: jesse@mccluresk9.com tags: trunk, master
Changes

Changes to src/xlib.c.

17
18
19
20
21
22
23

24
25
26
27
28
29
30
...
415
416
417
418
419
420
421












422
423
424
425
426
427
428
...
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484







485


486
487


488
489

490

491
492
493
494
495
496
497
...
568
569
570
571
572
573
574

575
576
577
578
579
580
581
...
601
602
603
604
605
606
607

608


609
610
611
612
613
614
615
extern int sbar_parse(Bar *, const char *);
extern char *get_text(Client *, int);

static int apply_rules(Client *);
static int get_hints(Client *);
static int get_icon(Client *);
static int get_name(Client *);


static void buttonpress(XEvent *);
static void configurerequest(XEvent *);
static void enternotify(XEvent *);
static void expose(XEvent *);
static void keypress(XEvent *);
//static void keyrelease(XEvent *);
................................................................................
	if (c->title && c->title != noname) XFree(c->title);
	if ( !(c->title=get_text(c,NET_WM_NAME)) )
		if ( !(c->title=get_text(c,XA_WM_NAME)) )
			c->title = strdup(noname);
	return 0;
}














/**** EVENT HANDLERS ****/

void buttonpress(XEvent *ev) {
	XButtonEvent *e = &ev->xbutton;
	Client *c;
	if ( !(c=wintoclient(e->subwindow)) ) return;
................................................................................
	XUngrabPointer(dpy, CurrentTime);
}

void configurerequest(XEvent *ev) {
	XConfigureRequestEvent *e = &ev->xconfigurerequest;
	Client *c;
	XWindowChanges wc;
	wc.x=e->x; wc.y=e->y; wc.width=e->width; wc.height=e->height;
	if ( (c=wintoclient(e->window)) ) {
		if ( (e->value_mask & (CWWidth | CWHeight)) &&
				(e->width == m->w) && (e->height == m->h) ) {
			c->flags |= WIN_FULL;
		}
		else {
			if (e->value_mask & CWX) c->x = e->x;
			if (e->value_mask & CWY) c->x = e->y;
			if (e->value_mask & CWWidth) c->w = e->width;
			if (e->value_mask & CWHeight) c->w = e->height;
		}







		wc.x=c->x; wc.y=c->y; wc.width=c->w; wc.height=c->h;


	}
	if (e->window == root) return;


	wc.sibling = e->above;
	wc.stack_mode = e->detail;

	XConfigureWindow(dpy, e->window, e->value_mask, &wc);

	tile();
}

void enternotify(XEvent *ev) {
	if (mons->next) {
		int x = ev->xcrossing.x_root;
		int y = ev->xcrossing.y_root;
................................................................................
		c->tags = m->tags = (1<<i);
	}
	if (XGetTransientForHint(dpy, c->win, &c->parent))
		c->flags |= WIN_TRANS;
	else
		c->parent = e->parent;
	c->x = wa.x; c->y = wa.y; c->w = wa.width; c->h = wa.height;

	if (c->w == m->w && c->h == m->h) c->flags |= WIN_FULL;
	XSelectInput(dpy, c->win, PropertyChangeMask | EnterWindowMask);
	Client *p;
	switch (conf.attach) {
		case ATTACH_TOP: c->next = clients; clients = c; break;
		case ATTACH_BOTTOM: push_client(c, NULL); break;
		case ATTACH_ABOVE: push_client(c, m->focus->top); break;
................................................................................
		if (cmd) XFree(cmd);
		return;
	}
	if ( !(c=wintoclient(e->window)) ) return;
	if (e->atom == XA_WM_NAME) get_name(c);
	else if (e->atom == XA_WM_HINTS) get_hints(c);
	else if (e->atom == XA_WM_CLASS) apply_rules(c);

	// icon ?


	else return;
	tile();
}

void unmapnotify(XEvent *ev) {
	Client *c, *t;
	XUnmapEvent *e = &ev->xunmap;







>







 







>
>
>
>
>
>
>
>
>
>
>
>







 







<

<
<
<
<
<
|
|
|
|
<
>
>
>
>
>
>
>
|
>
>

<
>
>
|
|
>
|
>







 







>







 







>

>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
...
479
480
481
482
483
484
485

486





487
488
489
490

491
492
493
494
495
496
497
498
499
500
501

502
503
504
505
506
507
508
509
510
511
512
513
514
515
...
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
...
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
extern int sbar_parse(Bar *, const char *);
extern char *get_text(Client *, int);

static int apply_rules(Client *);
static int get_hints(Client *);
static int get_icon(Client *);
static int get_name(Client *);
static int get_size(Client *);

static void buttonpress(XEvent *);
static void configurerequest(XEvent *);
static void enternotify(XEvent *);
static void expose(XEvent *);
static void keypress(XEvent *);
//static void keyrelease(XEvent *);
................................................................................
	if (c->title && c->title != noname) XFree(c->title);
	if ( !(c->title=get_text(c,NET_WM_NAME)) )
		if ( !(c->title=get_text(c,XA_WM_NAME)) )
			c->title = strdup(noname);
	return 0;
}

int get_size(Client *c) {
	long ret;
	XSizeHints hint;
	if (!(XGetWMNormalHints(dpy,c->win,&hint,&ret))) hint.flags = 0;
	if (hint.flags & PBaseSize) {
		c->w = hint.base_width; c->h = hint.base_height;
	}
	else if (hint.flags & PMinSize) {
		c->w = hint.min_width; c->h = hint.min_height;
	}
	return 0;
}

/**** EVENT HANDLERS ****/

void buttonpress(XEvent *ev) {
	XButtonEvent *e = &ev->xbutton;
	Client *c;
	if ( !(c=wintoclient(e->subwindow)) ) return;
................................................................................
	XUngrabPointer(dpy, CurrentTime);
}

void configurerequest(XEvent *ev) {
	XConfigureRequestEvent *e = &ev->xconfigurerequest;
	Client *c;
	XWindowChanges wc;

	if ( (c=wintoclient(e->window)) ) {





		if (e->value_mask & CWX) c->x = e->x;
		if (e->value_mask & CWY) c->y = e->y;
		if (e->value_mask & CWWidth) c->w = e->width;
		if (e->value_mask & CWHeight) c->h = e->height;

		if (c->w == m->w && c->h == m->h) c->flags |= WIN_FULL;
		/* Let gtk3 windows know we're listening: */
		XConfigureEvent cn;
		cn.type = ConfigureNotify; cn.display = dpy;
		cn.event = cn.window = c->win;
		cn.x = c->x; cn.y = c->y; cn.width = c->w; cn.height = c->h;
		cn.border_width = 0;
		cn.above = None;
		cn.override_redirect = False;
		XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&cn);
	}

	else {
		wc.x=e->x; wc.y=e->y; wc.width=e->width; wc.height=e->height;
		wc.sibling = e->above;
		wc.stack_mode = e->detail;
		wc.border_width = e->border_width;
		XConfigureWindow(dpy, e->window, e->value_mask, &wc);
	}
	tile();
}

void enternotify(XEvent *ev) {
	if (mons->next) {
		int x = ev->xcrossing.x_root;
		int y = ev->xcrossing.y_root;
................................................................................
		c->tags = m->tags = (1<<i);
	}
	if (XGetTransientForHint(dpy, c->win, &c->parent))
		c->flags |= WIN_TRANS;
	else
		c->parent = e->parent;
	c->x = wa.x; c->y = wa.y; c->w = wa.width; c->h = wa.height;
	get_size(c);
	if (c->w == m->w && c->h == m->h) c->flags |= WIN_FULL;
	XSelectInput(dpy, c->win, PropertyChangeMask | EnterWindowMask);
	Client *p;
	switch (conf.attach) {
		case ATTACH_TOP: c->next = clients; clients = c; break;
		case ATTACH_BOTTOM: push_client(c, NULL); break;
		case ATTACH_ABOVE: push_client(c, m->focus->top); break;
................................................................................
		if (cmd) XFree(cmd);
		return;
	}
	if ( !(c=wintoclient(e->window)) ) return;
	if (e->atom == XA_WM_NAME) get_name(c);
	else if (e->atom == XA_WM_HINTS) get_hints(c);
	else if (e->atom == XA_WM_CLASS) apply_rules(c);
	else if (e->atom == XA_WM_NORMAL_HINTS) get_size(c);
	// icon ?
	// netWM
	// XA_TRANSIENT_FOR
	else return;
	tile();
}

void unmapnotify(XEvent *ev) {
	Client *c, *t;
	XUnmapEvent *e = &ev->xunmap;