1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 05:48:01 +01:00

Removed unused code in screen.c

This patch removes the unused code in screen.c.

The variable "dock_head", is defined, but not used. When we removes
the variable, then we can see that a lot of code is not used! so we
can remove it :-)

This patch also removes some extra curly brackets and join the variable
definition and the initialization in one line for some variables.
This commit is contained in:
Rodolfo García Peñas (kix)
2014-01-31 20:08:03 +01:00
committed by Carlos R. Mafra
parent 761f3c6e85
commit 0bb96cdfe7

View File

@@ -682,23 +682,10 @@ void wScreenUpdateUsableArea(WScreen * scr)
*/
WArea area;
int i, dock_head;
unsigned long best_area, tmp_area;
unsigned int size, position;
dock_head = scr->xine_info.primary_head;
best_area = 0;
size = wPreferences.workspace_border_size;
position = wPreferences.workspace_border_position;
if (scr->dock) {
WMRect rect;
rect.pos.x = scr->dock->x_pos;
rect.pos.y = scr->dock->y_pos;
rect.size.width = wPreferences.icon_size;
rect.size.height = wPreferences.icon_size;
dock_head = wGetHeadForRect(scr, rect);
}
int i;
unsigned long tmp_area, best_area = 0;
unsigned int size = wPreferences.workspace_border_size;
unsigned int position = wPreferences.workspace_border_position;
for (i = 0; i < wXineramaHeads(scr); ++i) {
WMRect rect = wGetRectForHead(scr, i);
@@ -716,25 +703,19 @@ void wScreenUpdateUsableArea(WScreen * scr)
scr->usableArea[i] = scr->totalUsableArea[i];
#if 0
printf("usableArea[%d]: %d %d %d %d\n", i,
scr->usableArea[i].x1, scr->usableArea[i].x2, scr->usableArea[i].y1, scr->usableArea[i].y2);
#endif
if (wPreferences.no_window_over_icons) {
if (wPreferences.icon_yard & IY_VERT) {
if (wPreferences.icon_yard & IY_RIGHT) {
if (wPreferences.icon_yard & IY_RIGHT)
scr->totalUsableArea[i].x2 -= wPreferences.icon_size;
} else {
else
scr->totalUsableArea[i].x1 += wPreferences.icon_size;
}
} else {
if (wPreferences.icon_yard & IY_TOP) {
if (wPreferences.icon_yard & IY_TOP)
scr->totalUsableArea[i].y1 += wPreferences.icon_size;
} else {
else
scr->totalUsableArea[i].y2 -= wPreferences.icon_size;
}
}
}
if (scr->totalUsableArea[i].x2 - scr->totalUsableArea[i].x1 < rect.size.width / 2) {
scr->totalUsableArea[i].x1 = rect.pos.x;