This commit is contained in:
Mikael Magnusson 2006-11-15 21:12:06 +00:00
parent 59d35252dd
commit d3d4aa2987
12 changed files with 71 additions and 37 deletions

View file

@ -1606,19 +1606,23 @@ void action_movetoedge(union ActionData *data)
switch(data->diraction.direction) {
case OB_DIRECTION_NORTH:
y = client_directional_edge_search(c, OB_DIRECTION_NORTH, data->diraction.hang)
y = client_directional_edge_search(c, OB_DIRECTION_NORTH,
data->diraction.hang)
- (data->diraction.hang ? c->frame->area.height : 0);
break;
case OB_DIRECTION_WEST:
x = client_directional_edge_search(c, OB_DIRECTION_WEST, data->diraction.hang)
x = client_directional_edge_search(c, OB_DIRECTION_WEST,
data->diraction.hang)
- (data->diraction.hang ? c->frame->area.width : 0);
break;
case OB_DIRECTION_SOUTH:
y = client_directional_edge_search(c, OB_DIRECTION_SOUTH, data->diraction.hang)
y = client_directional_edge_search(c, OB_DIRECTION_SOUTH,
data->diraction.hang)
- (data->diraction.hang ? 0 : c->frame->area.height);
break;
case OB_DIRECTION_EAST:
x = client_directional_edge_search(c, OB_DIRECTION_EAST, data->diraction.hang)
x = client_directional_edge_search(c, OB_DIRECTION_EAST,
data->diraction.hang)
- (data->diraction.hang ? 0 : c->frame->area.width);
break;
default:

View file

@ -218,10 +218,11 @@ static ObAppSettings *get_settings(ObClient *client)
&& !strcmp(app->name, client->name))
) {
ob_debug("Window matching: %s\n", app->name);
/* Match if no role was specified in the per app setting, or if the string
* matches the beginning of the role, since apps like to set the role to
* things like browser-window-23c4b2f */
if (!app->role || !strncmp(app->role, client->role, strlen(app->role)))
/* Match if no role was specified in the per app setting, or if the
* string matches the beginning of the role, since apps like to set
* the role to things like browser-window-23c4b2f */
if (!app->role
|| !strncmp(app->role, client->role, strlen(app->role)))
return app;
}
@ -3274,7 +3275,8 @@ gint client_directional_edge_search(ObClient *c, ObDirection dir, gboolean hang)
his_edge_start = cur->frame->area.x;
his_edge_end = cur->frame->area.x + cur->frame->area.width;
his_offset = cur->frame->area.y + (hang ? 0 : cur->frame->area.height);
his_offset = cur->frame->area.y +
(hang ? 0 : cur->frame->area.height);
if(his_offset + 1 > my_offset)
continue;
@ -3292,7 +3294,8 @@ gint client_directional_edge_search(ObClient *c, ObDirection dir, gboolean hang)
/* default: bottom of screen */
dest = a->y + a->height - (hang ? c->frame->area.height : 0);
monitor_dest = monitor->y + monitor->height - (hang ? c->frame->area.height : 0);
monitor_dest = monitor->y + monitor->height -
(hang ? c->frame->area.height : 0);
/* if the monitor edge comes before the screen edge, */
/* use that as the destination instead. (For xinerama) */
if (monitor_dest != dest && my_offset < monitor_dest)
@ -3306,7 +3309,8 @@ gint client_directional_edge_search(ObClient *c, ObDirection dir, gboolean hang)
his_edge_start = cur->frame->area.x;
his_edge_end = cur->frame->area.x + cur->frame->area.width;
his_offset = cur->frame->area.y + (hang ? cur->frame->area.height : 0);
his_offset = cur->frame->area.y +
(hang ? cur->frame->area.height : 0);
if(his_offset - 1 < my_offset)
@ -3339,7 +3343,8 @@ gint client_directional_edge_search(ObClient *c, ObDirection dir, gboolean hang)
his_edge_start = cur->frame->area.y;
his_edge_end = cur->frame->area.y + cur->frame->area.height;
his_offset = cur->frame->area.x + (hang ? 0 : cur->frame->area.width);
his_offset = cur->frame->area.x +
(hang ? 0 : cur->frame->area.width);
if(his_offset + 1 > my_offset)
continue;
@ -3357,7 +3362,8 @@ gint client_directional_edge_search(ObClient *c, ObDirection dir, gboolean hang)
/* default: rightmost edge of screen */
dest = a->x + a->width - (hang ? c->frame->area.width : 0);
monitor_dest = monitor->x + monitor->width - (hang ? c->frame->area.width : 0);
monitor_dest = monitor->x + monitor->width -
(hang ? c->frame->area.width : 0);
/* if the monitor edge comes before the screen edge, */
/* use that as the destination instead. (For xinerama) */
if (monitor_dest != dest && my_offset < monitor_dest)
@ -3371,7 +3377,8 @@ gint client_directional_edge_search(ObClient *c, ObDirection dir, gboolean hang)
his_edge_start = cur->frame->area.y;
his_edge_end = cur->frame->area.y + cur->frame->area.height;
his_offset = cur->frame->area.x + (hang ? cur->frame->area.width : 0);
his_offset = cur->frame->area.x +
(hang ? cur->frame->area.width : 0);
if(his_offset - 1 < my_offset)
continue;

View file

@ -75,7 +75,8 @@ static void desk_menu_update(ObMenuFrame *frame, gpointer data)
e = menu_add_normal(menu, i,
(c->iconic ? c->icon_title : c->title), acts);
if (config_menu_client_list_icons && (icon = client_icon(c, 32, 32))) {
if (config_menu_client_list_icons
&& (icon = client_icon(c, 32, 32))) {
e->data.normal.icon_width = icon->width;
e->data.normal.icon_height = icon->height;
e->data.normal.icon_data = icon->data;

View file

@ -1287,7 +1287,8 @@ static gboolean focus_delay_func(gpointer data)
static void focus_delay_client_dest(ObClient *client, gpointer data)
{
ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func, client, TRUE);
ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func,
client, TRUE);
}
static void event_client_dest(ObClient *client, gpointer data)

View file

@ -581,7 +581,8 @@ static void layout_title(ObFrame *self)
break;
case 'D':
if (d) { *lc = ' '; break; }
if (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) && config_theme_hidedisabled)
if (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS)
&& config_theme_hidedisabled)
break;
d = TRUE;
self->label_width -= (ob_rr_theme->button_size +
@ -589,7 +590,8 @@ static void layout_title(ObFrame *self)
break;
case 'S':
if (s) { *lc = ' '; break; }
if (!(self->decorations & OB_FRAME_DECOR_SHADE) && config_theme_hidedisabled)
if (!(self->decorations & OB_FRAME_DECOR_SHADE)
&& config_theme_hidedisabled)
break;
s = TRUE;
self->label_width -= (ob_rr_theme->button_size +
@ -597,7 +599,8 @@ static void layout_title(ObFrame *self)
break;
case 'I':
if (i) { *lc = ' '; break; }
if (!(self->decorations & OB_FRAME_DECOR_ICONIFY) && config_theme_hidedisabled)
if (!(self->decorations & OB_FRAME_DECOR_ICONIFY)
&& config_theme_hidedisabled)
break;
i = TRUE;
self->label_width -= (ob_rr_theme->button_size +
@ -609,7 +612,8 @@ static void layout_title(ObFrame *self)
break;
case 'M':
if (m) { *lc = ' '; break; }
if (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) && config_theme_hidedisabled)
if (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE)
&& config_theme_hidedisabled)
break;
m = TRUE;
self->label_width -= (ob_rr_theme->button_size +
@ -617,7 +621,8 @@ static void layout_title(ObFrame *self)
break;
case 'C':
if (c) { *lc = ' '; break; }
if (!(self->decorations & OB_FRAME_DECOR_CLOSE) && config_theme_hidedisabled)
if (!(self->decorations & OB_FRAME_DECOR_CLOSE)
&& config_theme_hidedisabled)
break;
c = TRUE;
self->label_width -= (ob_rr_theme->button_size +

View file

@ -334,7 +334,8 @@ static gboolean place_under_mouse(ObClient *client, gint *x, gint *y)
return TRUE;
}
static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y, ObAppSettings *settings)
static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y,
ObAppSettings *settings)
{
gint px, py, i;
Rect *screen;
@ -414,7 +415,8 @@ static gboolean place_transient(ObClient *client, gint *x, gint *y)
}
/* Return TRUE if we want client.c to enforce on-screen-keeping */
gboolean place_client(ObClient *client, gint *x, gint *y, ObAppSettings *settings)
gboolean place_client(ObClient *client, gint *x, gint *y,
ObAppSettings *settings)
{
gboolean ret = FALSE;
if (client->positioned)

View file

@ -319,7 +319,8 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
vert_inc = -screen_desktop_layout.columns;
break;
case OB_CORNER_BOTTOMLEFT:
n = (screen_desktop_layout.rows - 1) * screen_desktop_layout.columns;
n = (screen_desktop_layout.rows - 1)
* screen_desktop_layout.columns;
horz_inc = 1;
vert_inc = -screen_desktop_layout.columns;
break;
@ -335,7 +336,8 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
vert_inc = 1;
break;
case OB_CORNER_TOPRIGHT:
n = screen_desktop_layout.rows * (screen_desktop_layout.columns - 1);
n = screen_desktop_layout.rows
* (screen_desktop_layout.columns - 1);
horz_inc = -screen_desktop_layout.rows;
vert_inc = 1;
break;

View file

@ -296,7 +296,8 @@ void screen_startup(gboolean reconfig)
screen_num_desktops = 0;
screen_set_num_desktops(config_desktops_num);
if (!reconfig) {
screen_set_desktop(MIN(config_screen_firstdesk, screen_num_desktops) - 1);
screen_set_desktop(MIN(config_screen_firstdesk, screen_num_desktops)
- 1);
/* don't start in showing-desktop mode */
screen_showing_desktop = FALSE;

View file

@ -284,7 +284,8 @@ void stacking_raise(ObWindow *window, gboolean group)
selected = WINDOW_AS_CLIENT(window);
c = client_search_top_transient(selected);
wins = pick_windows(c, selected, TRUE);
wins = g_list_concat(wins, pick_group_windows(c, selected, TRUE, group));
wins = g_list_concat(wins,
pick_group_windows(c, selected, TRUE, group));
} else {
wins = g_list_append(NULL, window);
stacking_list = g_list_remove(stacking_list, window);
@ -303,7 +304,8 @@ void stacking_lower(ObWindow *window, gboolean group)
selected = WINDOW_AS_CLIENT(window);
c = client_search_top_transient(selected);
wins = pick_windows(c, selected, FALSE);
wins = g_list_concat(pick_group_windows(c, selected, FALSE, group), wins);
wins = g_list_concat(pick_group_windows(c, selected, FALSE, group),
wins);
} else {
wins = g_list_append(NULL, window);
stacking_list = g_list_remove(stacking_list, window);

View file

@ -177,7 +177,8 @@ static void sn_event_func(SnMonitorEvent *ev, gpointer data)
case SN_MONITOR_EVENT_CANCELED:
if ((d = wait_find(sn_startup_sequence_get_id(seq)))) {
d->feedback = FALSE;
ob_main_loop_timeout_remove_data(ob_main_loop, sn_wait_timeout, d, FALSE);
ob_main_loop_timeout_remove_data(ob_main_loop, sn_wait_timeout,
d, FALSE);
change = TRUE;
}
break;

View file

@ -79,11 +79,16 @@ static void ImageCopyResampled(RrPixel32 *dst, RrPixel32 *src,
portionXY = (portionX * portionY) >> FRACTION;
sumXY += portionXY;
pixel = *(src + (srcY >> FRACTION) * srcW + (srcX >> FRACTION));
red += ((pixel >> RrDefaultRedOffset) & 0xFF) * portionXY;
green += ((pixel >> RrDefaultGreenOffset) & 0xFF) * portionXY;
blue += ((pixel >> RrDefaultBlueOffset) & 0xFF) * portionXY;
alpha += ((pixel >> RrDefaultAlphaOffset) & 0xFF) * portionXY;
pixel = *(src + (srcY >> FRACTION) * srcW
+ (srcX >> FRACTION));
red += ((pixel >> RrDefaultRedOffset) & 0xFF)
* portionXY;
green += ((pixel >> RrDefaultGreenOffset) & 0xFF)
* portionXY;
blue += ((pixel >> RrDefaultBlueOffset) & 0xFF)
* portionXY;
alpha += ((pixel >> RrDefaultAlphaOffset) & 0xFF)
* portionXY;
}
}

View file

@ -114,7 +114,8 @@ void RrPaint(RrAppearance *a, Window win, gint w, gint h)
case RR_TEXTURE_TEXT:
if (!transferred) {
transferred = 1;
if ((a->surface.grad != RR_SURFACE_SOLID) || (a->surface.interlaced))
if ((a->surface.grad != RR_SURFACE_SOLID)
|| (a->surface.interlaced))
pixel_data_to_pixmap(a, 0, 0, w, h);
}
if (a->xftdraw == NULL) {
@ -127,7 +128,8 @@ void RrPaint(RrAppearance *a, Window win, gint w, gint h)
case RR_TEXTURE_LINE_ART:
if (!transferred) {
transferred = 1;
if ((a->surface.grad != RR_SURFACE_SOLID) || (a->surface.interlaced))
if ((a->surface.grad != RR_SURFACE_SOLID)
|| (a->surface.interlaced))
pixel_data_to_pixmap(a, 0, 0, w, h);
}
XDrawLine(RrDisplay(a->inst), a->pixmap,
@ -140,7 +142,8 @@ void RrPaint(RrAppearance *a, Window win, gint w, gint h)
case RR_TEXTURE_MASK:
if (!transferred) {
transferred = 1;
if ((a->surface.grad != RR_SURFACE_SOLID) || (a->surface.interlaced))
if ((a->surface.grad != RR_SURFACE_SOLID)
|| (a->surface.interlaced))
pixel_data_to_pixmap(a, 0, 0, w, h);
}
RrPixmapMaskDraw(a->pixmap, &a->texture[i].data.mask, &tarea);