示例#1
0
文件: geometry.c 项目: fvwmorg/fvwm
void get_page_offset_rectangle(
	int *ret_page_x, int *ret_page_y, rectangle *r)
{
	int xoff = Scr.Vx % Scr.MyDisplayWidth;
	int yoff = Scr.Vy % Scr.MyDisplayHeight;

	/* maximize on the page where the center of the window is */
	*ret_page_x = truncate_to_multiple(
		r->x + r->width / 2 + xoff, Scr.MyDisplayWidth) - xoff;
	*ret_page_y = truncate_to_multiple(
		r->y + r->height / 2 + yoff, Scr.MyDisplayHeight) - yoff;

	return;
}
示例#2
0
void get_page_offset_rectangle(
	int *ret_page_x, int *ret_page_y, rectangle *r)
{
	struct monitor	*m = monitor_get_current();
	int xoff = m->virtual_scr.Vx % m->coord.w;
	int yoff = m->virtual_scr.Vy % m->coord.h;

	/* maximize on the page where the center of the window is */
	*ret_page_x = truncate_to_multiple(
		r->x + r->width / 2 + xoff, m->coord.w) - xoff;
	*ret_page_y = truncate_to_multiple(
		r->y + r->height / 2 + yoff, m->coord.h) - yoff;

	return;
}