Compare commits

...

6 Commits

Author SHA1 Message Date
Kim Woelders a162d5ab73 Update po 2023-11-26 10:04:33 +01:00
Kim Woelders 445b0449d1 Remove "Close" option from iconbox/systray menus
This prevents users from inadvertently destroying the iconbox(/systray)
thinking that it was the iconified application that would be closed.
To actually close the iconbox/systray just use the regular Window
options menu.

#13
2023-11-26 10:04:33 +01:00
Kim Woelders c9ab3da348 Pass screen geometry around in Area struct 2023-11-26 10:04:33 +01:00
Kim Woelders 214222e100 desktops: Maintain separate workareas for each desktop 2023-11-26 10:04:33 +01:00
Kim Woelders 5ce609cca7 Change formatting style
No tabs, more like K&R.
Also switch to indent 2.2.13.
2023-11-26 10:03:45 +01:00
Kim Woelders d317a785ac docs: Add forgotten misc.session.cmd_lock 2023-10-30 05:36:54 +01:00
208 changed files with 65507 additions and 65563 deletions

25
.indent.pro vendored
View File

@ -1,2 +1,23 @@
-i3 -bl -bad -nbap -sob -ncdb -di20 -nbc -lp -nce -npcs -sc -ncs -brs -l80
-nbad
--k-and-r-style
--procnames-start-lines
--brace-indent0
--break-after-boolean-operator
--no-tabs
--indent-level4
--braces-after-if-line
--blank-lines-after-declarations
--no-blank-lines-after-procedures
--swallow-optional-blank-lines
--no-comment-delimiters-on-blank-lines
--declaration-indentation16
--no-blank-lines-after-commas
--continue-at-parentheses
--dont-cuddle-else
--no-space-after-function-call-names
--start-left-side-of-comments
--no-space-after-casts
--braces-on-struct-decl-line
--line-length80
--no-blank-lines-after-declarations

View File

@ -1083,6 +1083,8 @@ misc.session.enable_reboot_halt = 0
misc.session.cmd_reboot = reboot
# [string] Halt command
misc.session.cmd_halt = poweroff
# [string] Lock command (if set, option is shown in logout dialog)
misc.session.cmd_lock =
# [string] Suspend command (if set, option is shown in logout dialog)
misc.session.cmd_suspend =
# [string] Hibernate command (if set, option is shown in logout dialog)

View File

@ -234,8 +234,7 @@ LoadFile(const char *file, const char *docfile)
f = fopen(s, "r");
if (!f)
{
printf("Edoc_dir %s does not contain a %s file\n", docdir,
docfile);
printf("Edoc_dir %s does not contain a %s file\n", docdir, docfile);
exit(1);
}
}
@ -557,8 +556,7 @@ main(int argc, char **argv)
char *exe;
exe = &(ll->name[5]);
execl("/bin/sh", "/bin/sh", "-c", exe,
NULL);
execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
exit(0);
}
}

View File

@ -877,8 +877,7 @@ RenderPage(Window win, int page_num, int w, int h)
while (txt_disp[(point + cnt)])
{
len =
mblen(txt_disp + point + cnt, MB_CUR_MAX);
len = mblen(txt_disp + point + cnt, MB_CUR_MAX);
if (len < 0)
{
cnt++;
@ -889,8 +888,7 @@ RenderPage(Window win, int page_num, int w, int h)
p1[cnt] = txt_disp[point + cnt];
p1[cnt] = 0;
TextSize(&ts, p1, &tw, &th);
if ((tw > xspace)
|| (!txt_disp[(point + cnt)]))
if ((tw > xspace) || (!txt_disp[(point + cnt)]))
{
if (txt_disp[(point + cnt)])
{
@ -907,8 +905,7 @@ RenderPage(Window win, int page_num, int w, int h)
wastext = 1;
TextDraw(&ts, win, p1, x + off, y,
xspace, 99999, justification);
next_y(w, h, col_w, &x, &y, &col,
pg, &ts, p1);
next_y(w, h, col_w, &x, &y, &col, pg, &ts, p1);
CalcOffset(pg, col_w, x, y, ts.height,
&xspace, &off);
}
@ -945,8 +942,7 @@ RenderPage(Window win, int page_num, int w, int h)
TextSize(&ts, txt_disp, &tw, &th);
extra = ((xspace - tw) * justification) >> 10;
TextDraw(&ts, win, link_txt,
x + off + lx + extra, y, 99999, 99999,
0);
x + off + lx + extra, y, 99999, 99999, 0);
TextSize(&ts, link_txt, &lw, &th);
XDrawLine(disp, win, gc,
x + off + lx + extra,
@ -971,8 +967,7 @@ RenderPage(Window win, int page_num, int w, int h)
link_link[0] = '\0';
link_txt[0] = '\0';
}
next_y(w, h, col_w, &x, &y, &col,
pg, &ts, txt_disp);
next_y(w, h, col_w, &x, &y, &col, pg, &ts, txt_disp);
}
eot = 0;
s[0] = 0;

View File

@ -28,7 +28,6 @@
#include "cpplib.h"
#include "cpphash.h"
#ifdef MULTIBYTE_CHARS
#include <locale.h>
#endif
@ -456,8 +455,7 @@ cpp_lex(struct operation *op, cpp_reader * pfile)
memset(buf, 0, 40);
sprintf(buf, "`%s' not allowed in operand of `#if'",
tok_start);
sprintf(buf, "`%s' not allowed in operand of `#if'", tok_start);
cpp_error(pfile, buf);
free(buf);
}
@ -988,8 +986,7 @@ cpp_parse_expr(cpp_reader * pfile)
case ':':
if (top[0].op != '?')
{
cpp_error(pfile,
"syntax error ':' without preceding '?'");
cpp_error(pfile, "syntax error ':' without preceding '?'");
goto syntax_error;
}
else if (!(top[1].flags & HAVE_VALUE)

View File

@ -27,7 +27,6 @@ const char *version_string = "0.0.0";
#include "config.h"
#ifndef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR "/usr/include"
#endif
@ -351,13 +350,10 @@ struct arglist *reverse_token_list(struct arglist *tokens);
static int parse_name(cpp_reader * pfile, int c);
static void parse_set_mark(struct parse_marker *pmark,
cpp_reader * pfile);
static void parse_set_mark(struct parse_marker *pmark, cpp_reader * pfile);
static void parse_clear_mark(struct parse_marker *pmark);
static void parse_goto_mark(struct parse_marker *pmark,
cpp_reader * pfile);
static void parse_move_mark(struct parse_marker *pmark,
cpp_reader * pfile);
static void parse_goto_mark(struct parse_marker *pmark, cpp_reader * pfile);
static void parse_move_mark(struct parse_marker *pmark, cpp_reader * pfile);
struct file_name_list {
file_name_list *next;
@ -570,7 +566,8 @@ cpp_grow_buffer(cpp_reader * pfile, long n)
pfile->token_buffer_size = n + 2 * pfile->token_buffer_size;
pfile->token_buffer =
(unsigned char *)xrealloc(pfile->token_buffer, pfile->token_buffer_size);
(unsigned char *)xrealloc(pfile->token_buffer,
pfile->token_buffer_size);
CPP_SET_WRITTEN(pfile, old_written);
}
@ -1426,8 +1423,7 @@ collect_expansion(cpp_reader * pfile, unsigned char *buf, unsigned char *limit,
unsigned char *p1 = p;
SKIP_WHITE_SPACE(p1);
if (p1 + 2 <= limit && p1[0] == '#'
&& p1[1] == '#')
if (p1 + 2 <= limit && p1[0] == '#' && p1[1] == '#')
tpat->raw_after = 1;
}
lastp = exp_p; /* place to start copying from next time */
@ -3785,8 +3781,7 @@ do_line(cpp_reader * pfile, struct directive *keyword __UNUSED__,
CPP_SET_WRITTEN(pfile, num_start);
token = get_directive_token(pfile);
p = pfile->token_buffer + num_start;
if (token == CPP_NUMBER && p[1] == '\0'
&& (*p == '3' || *p == '4'))
if (token == CPP_NUMBER && p[1] == '\0' && (*p == '3' || *p == '4'))
{
ip->system_header_p = *p == 3 ? 1 : 2;
token = get_directive_token(pfile);
@ -3853,7 +3848,8 @@ do_undef(cpp_reader * pfile, struct directive *keyword, unsigned char *buf,
/* If we are generating additional info for debugging (with -g) we
* need to pass through all effective #undef commands. */
if (CPP_OPTIONS(pfile)->debug_output && keyword)
pass_thru_directive((char *)orig_buf, (char *)limit, pfile, keyword);
pass_thru_directive((char *)orig_buf, (char *)limit, pfile,
keyword);
if (hp->type != T_MACRO)
cpp_warning(pfile, "undefining `%s'", hp->name);
delete_macro(hp);
@ -4265,8 +4261,7 @@ skip_if_group(cpp_reader * pfile, int any)
case T_IF:
case T_IFDEF:
case T_IFNDEF:
temp
=
temp =
(IF_STACK_FRAME *) xcalloc(1, sizeof(IF_STACK_FRAME));
temp->next = pfile->if_stack;
pfile->if_stack = temp;
@ -4275,18 +4270,15 @@ skip_if_group(cpp_reader * pfile, int any)
break;
case T_ELSE:
case T_ENDIF:
if (CPP_PEDANTIC(pfile)
&& pfile->if_stack != save_if_stack)
if (CPP_PEDANTIC(pfile) && pfile->if_stack != save_if_stack)
validate_else(pfile,
kt->type ==
T_ELSE ? "#else" : "#endif");
kt->type == T_ELSE ? "#else" : "#endif");
/* FALLTHROUGH */
case T_ELIF:
if (pfile->if_stack == CPP_BUFFER(pfile)->if_stack)
{
cpp_error(pfile,
"`#%s' not within a conditional",
kt->name);
"`#%s' not within a conditional", kt->name);
break;
}
else if (pfile->if_stack == save_if_stack)
@ -5305,7 +5297,6 @@ struct file_name_map {
char *map_to;
};
static int
open_include_file(cpp_reader *pfile __UNUSED__, char *filename,
file_name_list *searchptr __UNUSED__)
@ -5313,7 +5304,6 @@ open_include_file(cpp_reader * pfile __UNUSED__, char *filename,
return open(filename, O_RDONLY, 0666);
}
/* Process the contents of include file FNAME, already open on descriptor F,
* with output to OP.
* SYSTEM_HEADER_P is 1 if this file resides in any one of the known
@ -5523,8 +5513,7 @@ push_parse_file(cpp_reader * pfile, const char *fname)
termination++;
if (*termination++ != ')')
abort();
if (*termination && *termination != ' '
&& *termination != '\t')
if (*termination && *termination != ' ' && *termination != '\t')
abort();
/* Temporarily null-terminate the value. */
save_char = *termination;
@ -5681,8 +5670,7 @@ push_parse_file(cpp_reader * pfile, const char *fname)
int this_len =
strlen(specd_prefix) + strlen(di->fname) -
default_len;
char *str =
(char *)xmalloc(this_len + 1);
char *str = (char *)xmalloc(this_len + 1);
strcpy(str, specd_prefix);
strcat(str, di->fname + default_len);
@ -6017,8 +6005,7 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
if (i + 1 == argc)
cpp_fatal("Filename missing after `-isystem' option");
dirtmp =
(file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp = (file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp->next = 0;
dirtmp->control_macro = 0;
@ -6046,13 +6033,11 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
{
prefix = savestring(GCC_INCLUDE_DIR);
/* Remove the `include' from /usr/local/lib/gcc.../include. */
if (!strcmp
(prefix + strlen(prefix) - 8, "/include"))
if (!strcmp(prefix + strlen(prefix) - 8, "/include"))
prefix[strlen(prefix) - 7] = 0;
}
dirtmp =
(file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp = (file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
@ -6086,13 +6071,11 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
{
prefix = savestring(GCC_INCLUDE_DIR);
/* Remove the `include' from /usr/local/lib/gcc.../include. */
if (!strcmp
(prefix + strlen(prefix) - 8, "/include"))
if (!strcmp(prefix + strlen(prefix) - 8, "/include"))
prefix[strlen(prefix) - 7] = 0;
}
dirtmp =
(file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp = (file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
@ -6114,8 +6097,7 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
{
file_name_list *dirtmp;
dirtmp =
(file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp = (file_name_list *) xmalloc(sizeof(file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
@ -6264,8 +6246,7 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
if (!strcmp(argv[i], "-MD") || !strcmp(argv[i], "-MMD"))
{
if (i + 1 == argc)
cpp_fatal("Filename missing after %s option",
argv[i]);
cpp_fatal("Filename missing after %s option", argv[i]);
opts->deps_file = argv[++i];
}
else
@ -6354,8 +6335,7 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
struct cpp_pending *pend = *ptr;
if (pend->cmd && pend->cmd[0] == '-'
&& (pend->cmd[1] == 'D'
|| pend->cmd[1] == 'A'))
&& (pend->cmd[1] == 'D' || pend->cmd[1] == 'A'))
{
*ptr = pend->next;
free(pend);
@ -6417,8 +6397,7 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
if (argv[i][2] != 0)
dirtmp->fname = argv[i] + 2;
else if (i + 1 == argc)
cpp_fatal
("Directory name missing after -I option");
cpp_fatal("Directory name missing after -I option");
else
dirtmp->fname = argv[++i];
dirtmp->got_name_map = 0;
@ -6476,8 +6455,7 @@ cpp_finish(cpp_reader * pfile)
/* Don't actually write the deps file if compilation has failed. */
if (pfile->errors == 0)
{
const char *deps_mode =
opts->print_deps_append ? "a" : "w";
const char *deps_mode = opts->print_deps_append ? "a" : "w";
if (!opts->deps_file)
deps_stream = stdout;

View File

@ -635,4 +635,3 @@ int cpp_read_check_assertion(cpp_reader * pfile);
void *xmalloc(unsigned size);
void *xrealloc(void *old, unsigned size);
void *xcalloc(unsigned number, unsigned size);

View File

@ -108,15 +108,13 @@ XCreateWindow(Display * display, Window parent, int x, int y,
typedef Window(CSWF) (Display * _display, Window _parent, int _x,
int _y, unsigned int _width,
unsigned int _height,
unsigned int _border_width,
unsigned long _border,
unsigned long _background);
unsigned int _height, unsigned int _border_width,
unsigned long _border, unsigned long _background);
__EXPORT__ Window
XCreateSimpleWindow(Display *display, Window parent, int x, int y,
unsigned int width, unsigned int height,
unsigned int border_width,
unsigned int width,
unsigned int height, unsigned int border_width,
unsigned long border, unsigned long background)
{
static CSWF *func = NULL;

View File

@ -31,8 +31,7 @@
#include <X11/Xlib.h>
#include "util.h"
typedef Status(RF) (Display * dpy, void *rep, int extra,
Bool discard);
typedef Status(RF) (Display * dpy, void *rep, int extra, Bool discard);
/* find the real Xlib and the real X function */
static void *

475
po/ar.po

File diff suppressed because it is too large Load Diff

475
po/bg.po

File diff suppressed because it is too large Load Diff

475
po/bs.po

File diff suppressed because it is too large Load Diff

475
po/ca.po

File diff suppressed because it is too large Load Diff

475
po/cs.po

File diff suppressed because it is too large Load Diff

475
po/csb.po

File diff suppressed because it is too large Load Diff

475
po/da.po

File diff suppressed because it is too large Load Diff

487
po/de.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

475
po/eo.po

File diff suppressed because it is too large Load Diff

475
po/es.po

File diff suppressed because it is too large Load Diff

475
po/fo.po

File diff suppressed because it is too large Load Diff

475
po/fr.po

File diff suppressed because it is too large Load Diff

475
po/gl.po

File diff suppressed because it is too large Load Diff

475
po/hr.po

File diff suppressed because it is too large Load Diff

475
po/hu.po

File diff suppressed because it is too large Load Diff

475
po/it.po

File diff suppressed because it is too large Load Diff

475
po/ja.po

File diff suppressed because it is too large Load Diff

475
po/ko.po

File diff suppressed because it is too large Load Diff

475
po/nb.po

File diff suppressed because it is too large Load Diff

475
po/nl.po

File diff suppressed because it is too large Load Diff

475
po/pl.po

File diff suppressed because it is too large Load Diff

475
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

475
po/ru.po

File diff suppressed because it is too large Load Diff

475
po/sk.po

File diff suppressed because it is too large Load Diff

475
po/sr.po

File diff suppressed because it is too large Load Diff

475
po/sv.po

File diff suppressed because it is too large Load Diff

475
po/tr.po

File diff suppressed because it is too large Load Diff

475
po/uk.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -573,8 +573,8 @@ ActionDecode(const char *line)
break;
}
aa =
ActionCreate(event, anymod, modifiers, anybut, button, anykey, key, NULL);
aa = ActionCreate(event, anymod, modifiers, anybut, button, anykey, key,
NULL);
ActionAddTo(aa, line + len);
return aa;
@ -864,7 +864,8 @@ BindingsSave(void)
AclassConfigWrite(ActionclassFind("BUTTONBINDINGS"), _ac_prf);
AclassConfigWrite(ActionclassFind("DESKBINDINGS"), _ac_prf);
AclassConfigWrite(ActionclassFindGlobal("KEYBINDINGS"), _ac_prf);
AclassConfigWrite(ActionclassFindGlobal("KEYBINDINGS_UNCHANGABLE"), _ac_prf);
AclassConfigWrite(ActionclassFindGlobal("KEYBINDINGS_UNCHANGABLE"),
_ac_prf);
fclose(fs);
_ac_fs = NULL;
@ -1241,7 +1242,8 @@ static const IpcItem AclassIpcArray[] = {
" aclass kb List key bindings\n"
" aclass kb set ... Set key bindings\n"
" aclass list [name/all] List action class[es]\n"
" aclass load [name] Reload action classes (default is bindings.cfg)\n"}
" aclass load [name] Reload action classes (default is bindings.cfg)\n"
}
};
/*

View File

@ -35,8 +35,7 @@ Action *ActionCreate(char event, char anymod, int mod, int anybut,
const char *tooltipstring);
void ActionAddTo(Action * aa, const char *params);
void ActionclassAddAction(ActionClass * ac, Action * aa);
void ActionclassSetTooltipString(ActionClass * ac,
const char *tts);
void ActionclassSetTooltipString(ActionClass * ac, const char *tts);
ActionClass *ActionclassFind(const char *name);
ActionClass *ActionclassAlloc(const char *name);
void ActionclassFree(ActionClass * ac);
@ -44,8 +43,7 @@ const char *ActionclassGetName(ActionClass * ac);
const char *ActionclassGetTooltipString(ActionClass * ac);
int ActionclassGetActionCount(ActionClass * ac);
Action *ActionclassGetAction(ActionClass * ac, int ix);
int ActionclassEvent(ActionClass * ac, XEvent * ev,
EWin * ewin);
int ActionclassEvent(ActionClass * ac, XEvent * ev, EWin * ewin);
int ActionclassesGlobalEvent(XEvent * ev);
void ActionclassesReload(void);

View File

@ -279,7 +279,8 @@ ShowAlert(const char *title,
x = y = -100;
ww = hh = 1;
win = XCreateWindow(dd, root, x, y, ww, hh, 0,
CopyFromParent, InputOutput, CopyFromParent, mask, &att);
CopyFromParent, InputOutput, CopyFromParent, mask,
&att);
gc = XCreateGC(dd, win, 0, &gcv);
if (colorful)

View File

@ -211,7 +211,8 @@ static void
_AnimatorDel(Animator *an)
{
Dprintf("%s: %u/%u: %#x %p C%d\n", __func__,
current_frame_num, skip_to_frame_num, EOW(an->eo), an, an->category);
current_frame_num, skip_to_frame_num, EOW(an->eo), an,
an->category);
Efree(an);
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2022 Kim Woelders
* Copyright (C) 2004-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -323,20 +323,17 @@ ArrangeRects(const RectBox * fixed, int fixed_count, RectBox * floating,
ty2 = starty + height;
if (initial_window)
{
int xx1, yy1, xx2, yy2;
Area area;
ScreenGetAvailableAreaByPointer(&xx1, &yy1, &xx2, &yy2,
Conf.place.ignore_struts);
xx2 += xx1;
yy2 += yy1;
if (tx1 < xx1)
tx1 = xx1;
if (tx2 > xx2)
tx2 = xx2;
if (ty1 < yy1)
ty1 = yy1;
if (ty2 > yy2)
ty2 = yy2;
ScreenGetAvailableAreaByPointer(&area, Conf.place.ignore_struts);
if (tx1 < area.x)
tx1 = area.x;
if (tx2 > area.x + area.w)
tx2 = area.x + area.w;
if (ty1 < area.y)
ty1 = area.y;
if (ty2 > area.y + area.h)
ty2 = area.y + area.h;
}
#if DEBUG_ARRANGE
Eprintf("Target area %d,%d -> %d,%d\n", tx1, ty1, tx2, ty2);
@ -536,8 +533,7 @@ ArrangeGetRectList(RectBox ** pfixed, int *nfixed, RectBox ** pfloating,
rb->p = EoGetLayer(ew);
#if DEBUG_ARRANGE
Eprintf("Add float: x,y=%4d,%4d wxh=%3dx%3d p=%2d: %s\n",
rb->x, rb->y, rb->w, rb->h, rb->p,
EobjGetName(eo));
rb->x, rb->y, rb->w, rb->h, rb->p, EobjGetName(eo));
#endif
continue;
}
@ -664,28 +660,28 @@ ArrangeEwinXY(EWin * ewin, int *px, int *py)
void
ArrangeEwinCenteredXY(EWin *ewin, int *px, int *py)
{
int x, y, w, h;
Area area;
ScreenGetAvailableAreaByPointer(&x, &y, &w, &h, Conf.place.ignore_struts);
*px = (w - EoGetW(ewin)) / 2 + x;
*py = (h - EoGetH(ewin)) / 2 + y;
ScreenGetAvailableAreaByPointer(&area, Conf.place.ignore_struts);
*px = (area.w - EoGetW(ewin)) / 2 + area.x;
*py = (area.h - EoGetH(ewin)) / 2 + area.y;
}
void
ArrangeEwinCenteredOn(EWin *ewin, int x, int y, int w, int h, int *px, int *py)
{
int sx, sy, sw, sh;
Area area;
x += (w - EoGetW(ewin)) / 2;
y += (h - EoGetH(ewin)) / 2;
ScreenGetAvailableArea(x, y, &sx, &sy, &sw, &sh, Conf.place.ignore_struts);
ScreenGetAvailableArea(x, y, &area, Conf.place.ignore_struts);
/* keep it all on this screen if possible */
x = MIN(x, sx + sw - EoGetW(ewin));
y = MIN(y, sy + sh - EoGetH(ewin));
x = MAX(x, sx);
y = MAX(y, sy);
x = MIN(x, area.x + area.w - EoGetW(ewin));
y = MIN(y, area.y + area.h - EoGetH(ewin));
x = MAX(x, area.x);
y = MAX(y, area.y);
*px = x;
*py = y;

View File

@ -867,8 +867,10 @@ EwinBorderMinShadeSize(const EWin * ewin, int *mw, int *mh)
int leftborderwidth, rightborderwidth;
int topborderwidth, bottomborderwidth;
pw = ewin->client.w + ewin->border->border.left + ewin->border->border.right;
ph = ewin->client.h + ewin->border->border.top + ewin->border->border.bottom;
pw = ewin->client.w +
ewin->border->border.left + ewin->border->border.right;
ph = ewin->client.h +
ewin->border->border.top + ewin->border->border.bottom;
for (i = 0; i < ewin->border->num_winparts; i++)
ewin->bits[i].w = -2;
@ -1437,7 +1439,8 @@ static int
_BorderNameCompare(const void *b1, const void *b2)
{
if (b1 && b2)
return strcmp((*(const Border **)b1)->name, (*(const Border **)b2)->name);
return strcmp((*(const Border **)b1)->name,
(*(const Border **)b2)->name);
return 0;
}

View File

@ -45,14 +45,12 @@ void ButtonHide(Button * b);
void ButtonMoveToCoord(Button * b, int x, int y);
void ButtonMoveRelative(Button * b, int dx, int dy);
EObj *ButtonSwallowInto(Button * b, EObj * eo);
void ButtonSetCallback(Button * b,
ButtonCbFunc * func, void *prm);
void ButtonSetCallback(Button * b, ButtonCbFunc * func, void *prm);
int ButtonDoShowDefault(const Button * b);
int ButtonEmbedWindow(Button * ButtonToUse,
EX_Window WindowToEmbed);
void ButtonsForeach(int id, Desk * dsk,
void (*func)(Button * b));
void ButtonsForeach(int id, Desk * dsk, void (*func)(Button * b));
void ButtonsMoveStickyToDesk(Desk * d);
int ButtonsConfigLoad(FILE * fs);

View File

@ -527,10 +527,12 @@ ConfigFileFind(const char *name, const char *themepath, int pp)
if (Mode.theme.variant)
file = Estrdupcat2(file, "_", Mode.theme.variant);
Esnprintf(s, sizeof(s), "%s/cached/cfg/%s.preparsed", EDirUserCache(), file);
Esnprintf(s, sizeof(s), "%s/cached/cfg/%s.preparsed", EDirUserCache(),
file);
ppfile = Estrdup(s);
if (!Mode.theme.cache_rebuild && exists(s) && moddate(s) > moddate(fullname))
if (!Mode.theme.cache_rebuild && exists(s) &&
moddate(s) > moddate(fullname))
goto done;
/* No preparesd file or source is newer. Do preparsing. */
@ -612,8 +614,7 @@ ThemeConfigLoad(void)
if ((i > 1) && (!p))
{
p = ProgressbarCreate(_("Enlightenment Starting..."), 400,
16);
p = ProgressbarCreate(_("Enlightenment Starting..."), 400, 16);
if (p)
ProgressbarShow(p);
}

View File

@ -48,8 +48,7 @@ static void _ContainerLayout(Container * ct, int *px, int *py, int *pw,
static void _ContainerDraw(Container * ct);
static void _ContainerEventScrollWin(Win win, XEvent * ev, void *prm);
static void _ContainerEventScrollbarWin(Win win, XEvent * ev,
void *prm);
static void _ContainerEventScrollbarWin(Win win, XEvent * ev, void *prm);
static void _ContainerEventCoverWin(Win win, XEvent * ev, void *prm);
static void _ContainerEventArrow1Win(Win win, XEvent * ev, void *prm);
static void _ContainerEventArrow2Win(Win win, XEvent * ev, void *prm);
@ -1095,7 +1094,8 @@ _ContainerDraw(Container * ct)
im = NULL;
}
else if (ct->ic_box &&
(!ct->nobg || (ct->type == IB_TYPE_SYSTRAY && !ct->draw_icon_base)))
(!ct->nobg ||
(ct->type == IB_TYPE_SYSTRAY && !ct->draw_icon_base)))
{
/* Start out with iconbox image class image */
im = ImageclassGetImageBlended(ct->ic_box, ct->icon_win, ib_w0, ib_h0,
@ -1186,10 +1186,6 @@ _ContainerShowMenu(Container * ct)
mi = MenuItemCreate(_("Settings..."), NULL, s, NULL);
MenuAddItem(m, mi);
Esnprintf(s, sizeof(s), "wop %#x cl", WinGetXwin(ct->win));
mi = MenuItemCreate(_("Close"), NULL, s, NULL);
MenuAddItem(m, mi);
if (ct->type == IB_TYPE_ICONBOX)
{
mi = MenuItemCreate(_("Create new iconbox"), NULL, "ibox new", NULL);

View File

@ -85,8 +85,7 @@ typedef struct {
static void _DeskRaise(unsigned int num);
static void _DeskLower(unsigned int num);
static void _DeskHandleEvents(Win win, XEvent * ev, void *prm);
static void _DeskButtonCallback(void *prm, XEvent * ev,
ActionClass * ac);
static void _DeskButtonCallback(void *prm, XEvent * ev, ActionClass * ac);
/* The desktops */
static Desktops desks;
@ -448,6 +447,11 @@ _DeskCreate(int desk, int configure)
HintsSetRootInfo(EoGetWin(dsk), NoXID, 0);
}
dsk->workarea.x = 0;
dsk->workarea.y = 0;
dsk->workarea.w = EoGetW(dsk);
dsk->workarea.h = EoGetH(dsk);
#if USE_BG_WIN_ON_ALL_DESKS /* TBD - Use per virtual root bg window? */
#if USE_COMPOSITE
/* Add background window */
@ -750,6 +754,11 @@ _DeskResize(int desk, int w, int h)
_DeskControlsDestroy(dsk, 1);
_DeskControlsCreate(dsk);
_DeskControlsShow(dsk, 1);
dsk->workarea.x = 0;
dsk->workarea.y = 0;
dsk->workarea.w = w;
dsk->workarea.h = h;
}
Desk *
@ -2232,7 +2241,8 @@ _DeskHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
#if USE_XRANDR
case EX_EVENT_SCREEN_CHANGE_NOTIFY:
{
XRRScreenChangeNotifyEvent *rrev = (XRRScreenChangeNotifyEvent *) ev;
XRRScreenChangeNotifyEvent *rrev =
(XRRScreenChangeNotifyEvent *) ev;
EventsRandrScreenChange(ev);
@ -2750,7 +2760,8 @@ CB_AreaDisplayRedraw(Dialog * d, int val, void *data)
Win win;
int w, h, ww, hh;
if ((val != 1) && (dd->prev_ax == dd->area_x) && (dd->prev_ay == dd->area_y))
if ((val != 1) && (dd->prev_ax == dd->area_x) &&
(dd->prev_ay == dd->area_y))
return;
dd->prev_ax = dd->area_x;

View File

@ -43,6 +43,7 @@ struct _desk {
Button *tag;
int current_area_x;
int current_area_y;
Area workarea;
struct {
Background *bg;
EObj *o;

View File

@ -706,8 +706,7 @@ DialogItemGetDialog(DItem * di)
}
void
DialogItemSetCallback(DItem * di, DialogCallbackFunc * func, int val,
void *data)
DialogItemSetCallback(DItem *di, DialogCallbackFunc *func, int val, void *data)
{
di->func = func;
di->val = val;
@ -1199,12 +1198,10 @@ DialogRealizeItem(Dialog * d, DItem * di)
if (dii->w <= 0 || dii->h <= 0)
goto skip;
dx =
di->x + x + dii->padding.left +
dx = di->x + x + dii->padding.left +
(((sw - (dii->padding.left + dii->padding.right) - dii->w) *
dii->align_h) >> 10);
dy =
di->y + y + dii->padding.top +
dy = di->y + y + dii->padding.top +
(((sh - (dii->padding.top + dii->padding.bottom) - dii->h) *
dii->align_v) >> 10);
dx -= dii->x;

View File

@ -81,8 +81,7 @@ typedef struct {
Dialog *DialogCreate(const char *name);
Dialog *DialogFind(const char *name);
void DialogBindKey(Dialog * d, const char *key,
DialogCallbackFunc * func, int val,
void *data);
DialogCallbackFunc * func, int val, void *data);
void DialogSetTitle(Dialog * d, const char *title);
void DialogSetExitFunction(Dialog * d, DialogExitFunc * func);
void DialogCallExitFunction(Dialog * d);
@ -122,14 +121,12 @@ void DialogItemCheckButtonSetPtr(DItem * di, char *onoff_ptr);
void DialogItemTableSetOptions(DItem * di, int num_columns,
char border, char homogenous_h,
char homogenous_v);
void DialogItemSeparatorSetOrientation(DItem * di,
char horizontal);
void DialogItemSeparatorSetOrientation(DItem * di, char horizontal);
void DialogItemImageSetFile(DItem * di, const char *image);
void DialogItemSetRowSpan(DItem * di, int row_span);
void DialogItemSetColSpan(DItem * di, int col_span);
void DialogItemRadioButtonSetFirst(DItem * di, DItem * first);
void DialogItemRadioButtonGroupSetValPtr(DItem * di,
int *val_ptr);
void DialogItemRadioButtonGroupSetValPtr(DItem * di, int *val_ptr);
void DialogItemRadioButtonGroupSetVal(DItem * di, int val);
void DialogItemSliderSetVal(DItem * di, int val);

View File

@ -625,8 +625,8 @@ make_shadow(float opacity, int width, int height)
for (y = 0; y < ylimit; y++)
for (x = 0; x < xlimit; x++)
{
d = sum_gaussian(gaussianMap, opacity, x - center, y - center, width,
height);
d = sum_gaussian(gaussianMap, opacity, x - center, y - center,
width, height);
data[y * swidth + x] = d;
data[(sheight - y - 1) * swidth + x] = d;
data[(sheight - y - 1) * swidth + (swidth - x - 1)] = d;
@ -1270,7 +1270,8 @@ ECompMgrWinNew(EObj * eo)
}
if (eo->type == EOBJ_TYPE_EXT)
eo->opacity = OpacityFromPercent(Conf_compmgr.override_redirect.opacity);
eo->opacity =
OpacityFromPercent(Conf_compmgr.override_redirect.opacity);
if (eo->opacity == 0)
eo->opacity = 0xFFFFFFFF;
@ -1562,7 +1563,8 @@ ECompMgrWinDumpInfo(const char *txt, EObj * eo, EX_SrvRegion rgn, int ipc)
prf = (ipc) ? IpcPrintf : Eprintf;
prf("%s %#x: %d,%d %dx%d: %s\n", txt, EobjGetXwin(eo),
EobjGetX(eo), EobjGetY(eo), EobjGetW(eo), EobjGetH(eo), EobjGetName(eo));
EobjGetX(eo), EobjGetY(eo), EobjGetW(eo), EobjGetH(eo),
EobjGetName(eo));
if (!cw)
{
prf("Not managed\n");

View File

@ -51,8 +51,7 @@ void ECompMgrWinMap(EObj * eo);
void ECompMgrWinUnmap(EObj * eo);
void ECompMgrWinMoveResize(EObj * eo, int change_xy,
int change_wh, int change_bw);
void ECompMgrWinDamageArea(EObj * eo, int x, int y, int w,
int h);
void ECompMgrWinDamageArea(EObj * eo, int x, int y, int w, int h);
void ECompMgrWinReparent(EObj * eo, Desk * dsk, int change_xy);
void ECompMgrWinRaiseLower(EObj * eo, int delta);
void ECompMgrWinChangeShape(EObj * eo);

View File

@ -57,7 +57,6 @@ const CfgItem *CfgItemFind(const CfgItem * pcl, int ncl, const char *name);
void CfgItemToString(const CfgItem * ci, char *buf, int len);
int CfgItemListNamedItemSet(const CfgItem * pcl, int ncl,
const char *item,
const char *value);
const char *item, const char *value);
#endif /* _ECONFIG_H_ */

View File

@ -65,11 +65,9 @@
/* GL functions and helper */
typedef void (*glXBindTexImageEXT_func)(Display * dpy,
GLXDrawable drawable,
int buffer,
const int *attrib_list);
int buffer, const int *attrib_list);
typedef void (*glXReleaseTexImageEXT_func)(Display * dpy,
GLXDrawable drawable,
int buffer);
GLXDrawable drawable, int buffer);
typedef void (*glXFuncPtr)(void);
typedef glXFuncPtr(*glXGetProcAddress_func) (const GLubyte *);

View File

@ -651,8 +651,8 @@ ScaleTile(Win wsrc, EX_Drawable src, Win wdst, EX_Pixmap dst,
Eprintf("%s: Tile %#x %dx%d -> %dx%d T %dx%d -> %dx%d\n", __func__,
src, stw, sth, tw, th, scale * dw, scale * dh, dw, dh);
#endif
tim =
EImageGrabDrawableScaled(wsrc, src, NoXID, 0, 0, stw, sth, tw, th, 0, 0);
tim = EImageGrabDrawableScaled(wsrc, src, NoXID, 0, 0, stw, sth,
tw, th, 0, 0);
im = EImageCreate(scale * dw, scale * dh);
EImageTile(im, tim, 0, tw, th, 0, 0, scale * dw, scale * dh, 0, 0);
EImageFree(tim);

View File

@ -82,8 +82,7 @@ void EImageOrientate(EImage * im, int orientation);
void EImageBlend(EImage * im, EImage * src, int flags,
int sx, int sy, int sw, int sh,
int dx, int dy, int dw, int dh,
int merge_alpha);
int dx, int dy, int dw, int dh, int merge_alpha);
void EImageTile(EImage * im, EImage * tile, int flags, int tw,
int th, int dx, int dy, int dw, int dh, int ox,
int oy);
@ -107,8 +106,7 @@ void EImageRenderPixmaps(EImage * im, Win win, int flags,
EX_Pixmap * mask, int w, int h);
void EImagePixmapsFree(EX_Pixmap pmap, EX_Pixmap mask);
void EImageApplyToWin(EImage * im, Win win, int flags,
int w, int h);
void EImageApplyToWin(EImage * im, Win win, int flags, int w, int h);
void ScaleRect(Win wsrc, EX_Drawable src, Win wdst,
EX_Pixmap dst, int sx, int sy, int sw, int sh,

View File

@ -381,8 +381,8 @@ EobjRegisterOR(EX_Window xwin __UNUSED__, XWindowAttributes * pxwa __UNUSED__,
eo->fade = 1;
eo->shadow = 1;
EobjInit(eo, EOBJ_TYPE_EXT, win, pxwa->x, pxwa->y, pxwa->width, pxwa->height,
0, NULL);
EobjInit(eo, EOBJ_TYPE_EXT, win,
pxwa->x, pxwa->y, pxwa->width, pxwa->height, 0, NULL);
if (win->argb)
eo->shadow = 0;

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2009 Kim Woelders
* Copyright (C) 2004-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -57,4 +57,11 @@ typedef struct _timer Timer;
typedef struct _idler Idler;
typedef struct _animator Animator;
typedef struct {
int x;
int y;
int w;
int h;
} Area;
#endif /* _ETYPES_H_ */

View File

@ -723,8 +723,7 @@ EventsCompress(XEvent * evq, int count)
switch (ev2->type)
{
case CreateNotify:
if (ev2->xcreatewindow.window !=
ev->xdestroywindow.window)
if (ev2->xcreatewindow.window != ev->xdestroywindow.window)
continue;
ev2->type = EX_EVENT_CREATE_GONE;
goto loop_quit_DestroyNotify;

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2022 Kim Woelders
* Copyright (C) 2004-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -1218,6 +1218,7 @@ void
EwinOpFullscreen(EWin *ewin, int source __UNUSED__, int on)
{
int x, y, w, h, ww, hh;
Area area;
EWin **lst;
int i, num;
const Border *b;
@ -1248,8 +1249,12 @@ EwinOpFullscreen(EWin * ewin, int source __UNUSED__, int on)
{
EventsUpdateXY(&x, &y);
}
ScreenGetAvailableArea(x, y, &x, &y, &w, &h,
ScreenGetAvailableArea(x, y, &area,
Conf.place.ignore_struts_fullscreen);
x = area.x;
y = area.y;
w = area.w;
h = area.h;
ewin->state.fullscreen = 1;

View File

@ -123,8 +123,7 @@ EwinCreate(int type)
}
static int
EwinGetAttributes(EWin * ewin, Win win, EX_Window xwin,
XWindowAttributes * pxwa)
EwinGetAttributes(EWin *ewin, Win win, EX_Window xwin, XWindowAttributes *pxwa)
{
XWindowAttributes xwa;
@ -270,7 +269,8 @@ EwinManage(EWin * ewin)
EChangeWindowAttributes(EoGetWin(ewin), CWDontPropagate, &att);
ESelectInput(EoGetWin(ewin), att.event_mask);
#else
EChangeWindowAttributes(EoGetWin(ewin), CWEventMask | CWDontPropagate, &att);
EChangeWindowAttributes(EoGetWin(ewin), CWEventMask | CWDontPropagate,
&att);
#endif
ewin->client.event_mask = EWIN_CLIENT_EVENT_MASK;
@ -636,29 +636,30 @@ EwinGetPosition(const EWin * ewin, int x, int y, int grav, int *px, int *py)
static void
EwinKeepOnScreen(const EWin *ewin, int wn, int hn, int *px, int *py)
{
int x = *px, y = *py, w, h;
int sx, sy, sw, sh, xy;
int x = *px, y = *py, w, h, xy;
Area area;
w = EoGetW(ewin);
h = EoGetH(ewin);
ScreenGetAvailableArea(x, y, &sx, &sy, &sw, &sh, Conf.place.ignore_struts);
ScreenGetAvailableArea(x, y, &area, Conf.place.ignore_struts);
/* Quit if not on-screen to begin with */
if (x < sx || x + w > sx + sw || y < sy || y + h > sy + sh)
if (x < area.x || x + w > area.x + area.w ||
y < area.y || y + h > area.y + area.h)
return;
/* Attempt to keep on-screen */
xy = sx + sw - (w - ewin->client.w + wn);
xy = area.x + area.w - (w - ewin->client.w + wn);
if (x > xy)
x = xy;
if (x < sx)
x = sx;
xy = sy + sh - (h - ewin->client.h + hn);
if (x < area.x)
x = area.x;
xy = area.y + area.h - (h - ewin->client.h + hn);
if (y > xy)
y = xy;
if (y < sy)
y = sy;
if (y < area.y)
y = area.y;
*px = x;
*py = y;
@ -1150,13 +1151,15 @@ _EwinRemanage(EWin * ewin, const char *str)
WinGetY(EwinGetContainerWin(ewin)) != y;
#endif
reparent = WinGetParent(EwinGetClientWin(ewin)) != EwinGetContainerWin(ewin);
reparent =
WinGetParent(EwinGetClientWin(ewin)) != EwinGetContainerWin(ewin);
Eprintf("%s: Already managing %s %#x %s: rp=%d mo=%d\n", __func__, str,
EwinGetClientXwin(ewin), EwinGetTitle(ewin), reparent, move);
if (reparent || move)
EReparentWindow(EwinGetClientWin(ewin), EwinGetContainerWin(ewin), x, y);
EReparentWindow(EwinGetClientWin(ewin), EwinGetContainerWin(ewin),
x, y);
}
static void
@ -1912,7 +1915,8 @@ EwinReposition(EWin * ewin)
yn = y;
#if 0 /* Debug */
Eprintf("Reposition %d,%d -> %d,%d: %s\n", x, y, xn, yn, EwinGetTitle(ewin));
Eprintf("Reposition %d,%d -> %d,%d: %s\n", x, y, xn, yn,
EwinGetTitle(ewin));
#endif
xn += ax * wdn;
@ -1999,7 +2003,8 @@ EwinPinOn(EWin * ewin, int on, int desk, int ax, int ay)
ewin->num_pinned--;
num = ewin->num_pinned - ix; /* Items to move */
if (num != 0)
memmove(ewin->pinned + ix, ewin->pinned + 1, num * sizeof(DeskArea));
memmove(ewin->pinned + ix, ewin->pinned + 1,
num * sizeof(DeskArea));
}
done:

View File

@ -58,8 +58,7 @@ typedef union {
typedef struct {
void (*Init)(EWin * ewin);
void (*Layout)(EWin * ewin, int *px, int *py, int *pw,
int *ph);
void (*Layout)(EWin * ewin, int *px, int *py, int *pw, int *ph);
void (*MoveResize)(EWin * ewin, int resize);
void (*Close)(EWin * ewin);
} EWinOps;
@ -390,8 +389,7 @@ EWin *AddInternalToFamily(Win win, const char *bname, int type,
const EWinOps * ops, void *ptr);
void EwinReparent(EWin * ewin, Win parent);
void EwinSetTitle(EWin * ewin, const char *title);
void EwinSetClass(EWin * ewin, const char *name,
const char *clss);
void EwinSetClass(EWin * ewin, const char *name, const char *clss);
const char *EwinGetTitle(const EWin * ewin);
const char *EwinGetIconName(const EWin * ewin);
const char *EwinBorderGetName(const EWin * ewin);
@ -424,8 +422,7 @@ void EwinsMovePinnedToDesk(Desk * dsk);
void EwinPinOn(EWin * ewin, int on, int desk, int ax, int ay);
int EwinIsPinnedOn(EWin * ewin, int desk, int ax, int ay);
int EwinIsPinnedMisplaced(EWin * ewin,
int desk, int ax, int ay);
int EwinIsPinnedMisplaced(EWin * ewin, int desk, int ax, int ay);
/* ewin-ops.c */
/* Move/resize flags */
@ -473,10 +470,8 @@ void EwinOpSetLayer(EWin * ewin, int source, int layer);
void EwinOpSetTitle(EWin * ewin, const char *title);
void EwinOpSetBorder(EWin * ewin, int source, const char *name);
void EwinOpSetOpacity(EWin * ewin, int source, int opacity);
void EwinOpSetFocusedOpacity(EWin * ewin, int source,
int opacity);
void EwinOpMoveToDesk(EWin * ewin, int source, Desk * dsk,
int inc);
void EwinOpSetFocusedOpacity(EWin * ewin, int source, int opacity);
void EwinOpMoveToDesk(EWin * ewin, int source, Desk * dsk, int inc);
void EwinOpFullscreen(EWin * ewin, int source, int on);
/* finders.c */

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2022 Kim Woelders
* Copyright (C) 2003-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -213,27 +213,25 @@ EWMH_SetDesktopSize(void)
void
EWMH_SetWorkArea(void)
{
unsigned int *p_coord;
int n_coord, i, n_desks;
Area *wa;
int i, n_desks;
Desk *dsk;
n_desks = DesksGetNumber();
n_coord = 4 * n_desks;
p_coord = EMALLOC(unsigned int, n_coord);
wa = EMALLOC(Area, n_desks);
if (!p_coord)
if (!wa)
return;
for (i = 0; i < n_desks; i++)
{
p_coord[4 * i] = 0;
p_coord[4 * i + 1] = 0;
p_coord[4 * i + 2] = WinGetW(VROOT);
p_coord[4 * i + 3] = WinGetH(VROOT);
dsk = DeskGet(i);
wa[i] = dsk->workarea;
}
ex_netwm_desk_workareas_set(WinGetXwin(VROOT), p_coord, n_desks);
ex_netwm_desk_workareas_set(WinGetXwin(VROOT), (unsigned int *)wa, n_desks);
Efree(p_coord);
Efree(wa);
}
void
@ -742,8 +740,10 @@ EWMH_SetWindowActions(const EWin * ewin)
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MINIMIZE, !ewin->state.inhibit_iconify);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_SHADE, !ewin->state.inhibit_shade);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_STICK, !ewin->state.inhibit_stick);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MAXIMIZE_HORZ, !ewin->state.inhibit_max_hor);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MAXIMIZE_VERT, !ewin->state.inhibit_max_ver);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MAXIMIZE_HORZ,
!ewin->state.inhibit_max_hor);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MAXIMIZE_VERT,
!ewin->state.inhibit_max_ver);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_FULLSCREEN,
!ewin->state.inhibit_fullscreeen);
ATOM_ADD_IF(ea_n._NET_WM_ACTION_CHANGE_DESKTOP,
@ -757,7 +757,8 @@ EWMH_SetWindowActions(const EWin * ewin)
((EWin *) ewin)->ewmh.current_actions = atom_mask;
ex_window_prop_atom_set(EwinGetClientXwin(ewin),
ea_n._NET_WM_ALLOWED_ACTIONS, atom_list, atom_count);
ea_n._NET_WM_ALLOWED_ACTIONS,
atom_list, atom_count);
}
void

View File

@ -285,8 +285,7 @@ ExtInitWinCreate(void)
/* Hack to give the child some space. Not foolproof. */
SleepUs(500000);
if (ex_window_prop_window_get
(WinGetXwin(RROOT), a, &win_ex, 1) > 0)
if (ex_window_prop_window_get(WinGetXwin(RROOT), a, &win_ex, 1) > 0)
break;
}

View File

@ -113,7 +113,8 @@ FocusEwinValid(EWin * ewin, int want_on_screen, int click, int want_visible)
ewin->state.state, EoIsShown(ewin),
ewin->state.inhibit_focus, ewin->state.sliding,
EwinIsOnScreen(ewin), want_on_screen,
ewin->state.visibility, want_visible, ok, click, ewin->props.focusclick);
ewin->state.visibility, want_visible, ok, click,
ewin->props.focusclick);
#endif
return ok;
}
@ -148,8 +149,7 @@ FocusEwinValidNew(EWin * ewin)
{
if ((EwinGetTransientFor(ewin) ==
EwinGetClientXwin(Mode.focuswin)) ||
(EwinGetWindowGroup(ewin) ==
EwinGetWindowGroup(Mode.focuswin)))
(EwinGetWindowGroup(ewin) == EwinGetWindowGroup(Mode.focuswin)))
ok = 1;
}
}
@ -678,8 +678,9 @@ FocusHandleEnter(EWin * ewin, XEvent * ev)
ev->xcrossing.detail == NotifyNonlinearVirtual)
{
if (EDebug(1))
Eprintf("%s: Previously ignored: focused: %s, enter: %s\n", __func__,
EoGetNameSafe(Mode.focuswin), EoGetNameSafe(ewin));
Eprintf("%s: Previously ignored: focused: %s, enter: %s\n",
__func__, EoGetNameSafe(Mode.focuswin),
EoGetNameSafe(ewin));
}
#endif

View File

@ -54,7 +54,8 @@ _GrabKeyboard(Win win, int sync_kbd)
#endif
#if 0
Eprintf("%s: %#lx sync=%d rc=%d\n", __func__, WinGetXwin(win), sync_kbd, rc);
Eprintf("%s: %#lx sync=%d rc=%d\n", __func__, WinGetXwin(win), sync_kbd,
rc);
#endif
return rc;
@ -115,7 +116,8 @@ GrabPointerSet(Win win, unsigned int csr, int confine __UNUSED__)
Mode.grabs.pointer_grab_active = 1;
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("%s: %#x, rc=%d\n", __func__, Mode.grabs.pointer_grab_window, rc);
Eprintf("%s: %#x, rc=%d\n", __func__, Mode.grabs.pointer_grab_window,
rc);
return rc;
}

View File

@ -925,7 +925,8 @@ _DlgFillGroups(Dialog * d, DItem * table, void *data)
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Pick the group to configure:"));
group_member_strings = _GrouplistMemberNames(ewin->groups, ewin->num_groups);
group_member_strings =
_GrouplistMemberNames(ewin->groups, ewin->num_groups);
if (!group_member_strings)
return; /* Silence clang - It should not be possible to go here */

View File

@ -471,7 +471,8 @@ EHintsGetDeskInfo(void)
return;
num = ex_window_prop_card32_get(WinGetXwin(VROOT),
ea_m.ENL_INTERNAL_AREA_DATA, c, 2 * n_desks);
ea_m.ENL_INTERNAL_AREA_DATA,
c, 2 * n_desks);
if (num > 0)
{
for (i = 0; i < (num / 2); i++)

View File

@ -48,11 +48,9 @@ void EWMH_SetWindowOpacity(EWin * ewin);
void EWMH_SetWindowActions(const EWin * ewin);
void EWMH_GetWindowHints(EWin * ewin);
void EWMH_DelWindowHints(const EWin * ewin);
int EWMH_ProcessPropertyChange(EWin * ewin,
EX_Atom atom_change);
int EWMH_ProcessPropertyChange(EWin * ewin, EX_Atom atom_change);
int EWMH_ProcessClientClientMessage(EWin * ewin,
XClientMessageEvent *
event);
XClientMessageEvent * event);
int EWMH_ProcessRootClientMessage(XClientMessageEvent * event);
/* hints.c */
@ -77,14 +75,12 @@ void HintsGetWindowHints(EWin * ewin);
void HintsDelWindowHints(const EWin * ewin);
void HintsProcessPropertyChange(EWin * ewin, XEvent * ev);
void HintsProcessClientClientMessage(EWin * ewin,
XClientMessageEvent *
event);
XClientMessageEvent * event);
void HintsProcessRootClientMessage(XClientMessageEvent * event);
EX_Pixmap HintsGetRootPixmap(Win win);
void HintsSetRootHints(Win win);
void HintsSetRootInfo(Win win, EX_Pixmap pmap,
unsigned int color);
void HintsSetRootInfo(Win win, EX_Pixmap pmap, unsigned int color);
void EHintsSetInfo(const EWin * ewin);
void EHintsGetInfo(EWin * ewin);
@ -99,8 +95,7 @@ void SelectionRelease(ESelection * sel);
/* icccm.c */
void ICCCM_Init(void);
int ICCCM_ProcessClientClientMessage(EWin * ewin,
XClientMessageEvent *
event);
XClientMessageEvent * event);
int ICCCM_ProcessRootClientMessage(XClientMessageEvent * event);
void ICCCM_GetTitle(EWin * ewin);
void ICCCM_Delete(const EWin * ewin);
@ -129,8 +124,7 @@ void ICCCM_Focus(const EWin * ewin);
void ICCCM_GetGeoms(EWin * ewin);
void ICCCM_GetInfo(EWin * ewin);
void ICCCM_GetHints(EWin * ewin);
int ICCCM_ProcessPropertyChange(EWin * ewin,
EX_Atom atom_change);
int ICCCM_ProcessPropertyChange(EWin * ewin, EX_Atom atom_change);
/* mwm.c */
void MWM_GetHints(EWin * ewin, EX_Atom atom_change);

View File

@ -542,7 +542,8 @@ ICCCM_GetGeoms(EWin * ewin)
}
ewin->props.no_resize_h = (ewin->icccm.width_min == ewin->icccm.width_max);
ewin->props.no_resize_v = (ewin->icccm.height_min == ewin->icccm.height_max);
ewin->props.no_resize_v =
(ewin->icccm.height_min == ewin->icccm.height_max);
if (EDebug(EDBUG_TYPE_SNAPS))
Eprintf("Snap get icccm %#x: %4d+%4d %4dx%4d: %s\n",
@ -595,7 +596,8 @@ ICCCM_GetWmClientMachine(EWin * ewin)
ea_i.WM_CLIENT_MACHINE);
if (!ewin->icccm.wm_machine && TryGroup(ewin))
ewin->icccm.wm_machine =
ex_window_prop_string_get(ewin->icccm.group, ea_i.WM_CLIENT_MACHINE);
ex_window_prop_string_get(ewin->icccm.group,
ea_i.WM_CLIENT_MACHINE);
}
static void
@ -728,8 +730,7 @@ ICCCM_GetWmProtocols(EWin * ewin)
ewin->ewmh.sync_request_enable = 1;
ex_window_prop_card32_get(EwinGetClientXwin(ewin),
ea_n._NET_WM_SYNC_REQUEST_COUNTER,
&c, 1);
ea_n._NET_WM_SYNC_REQUEST_COUNTER, &c, 1);
ewin->ewmh.sync_request_counter = c;
}
#endif
@ -893,7 +894,8 @@ EwinSyncRequestSend(EWin * ewin)
StructureNotifyMask,
ea_n._NET_WM_SYNC_REQUEST,
Mode.events.time,
(long)(count & 0xffffffff), (long)(count >> 32), 0);
(long)(count & 0xffffffff), (long)(count >> 32),
0);
return 1;
}

View File

@ -762,8 +762,7 @@ ImagestateMakePmapMask(ImageState * is, Win win, PmapMask * pmm,
XDrawRectangle(disp, win, gc, x, y, w, h);
static void
ImagestateDrawBevel(ImageState * is, EX_Drawable win,
int x, int y, int w, int h)
ImagestateDrawBevel(ImageState *is, EX_Drawable win, int x, int y, int w, int h)
{
GC gc;

View File

@ -69,14 +69,13 @@ char *ImageclassGetFile(ImageClass * ic);
EImage *ImageclassGetImage(ImageClass * ic, int active, int sticky,
int state);
void ImageclassApplySimple(ImageClass * ic, Win win,
EX_Drawable draw, int state, int x,
int y, int w, int h);
EX_Drawable draw, int state,
int x, int y, int w, int h);
void ImageclassApply(ImageClass * ic, Win win,
int active, int sticky, int state);
void ImageclassApplyCopy(ImageClass * ic, Win win, int w,
int h, int active, int sticky,
int state, PmapMask * pmm,
int pmapflags);
void ImageclassApplyCopy(ImageClass * ic, Win win, int w, int h,
int active, int sticky, int state,
PmapMask * pmm, int pmapflags);
EImage *ImageclassGetImageBlended(ImageClass * ic, Win win,
int w, int h, int active,
int sticky, int state);

View File

@ -227,7 +227,8 @@ IB_GetFallbackIcon(EWin * ewin, int size)
IB_IconGetSize(ww, hh, size, 1, &w, &h);
ic = ImageclassFind("ICONBOX_HORIZONTAL", 1);
im = ImageclassGetImageBlended(ic, EoGetWin(ewin), w, h, 0, 0, STATE_NORMAL);
im = ImageclassGetImageBlended(ic, EoGetWin(ewin), w, h, 0, 0,
STATE_NORMAL);
return im;
}

View File

@ -367,12 +367,10 @@ IPC_WinListFmt(char *buf, unsigned int len, const char *fmt, EWin * e)
e->place.gy, e->place.ax, e->place.ay);
break;
case 'P': /* Win X Y */
nw += snprintf(buf + nw, len - nw, "%5d %5d",
EoGetX(e), EoGetY(e));
nw += snprintf(buf + nw, len - nw, "%5d %5d", EoGetX(e), EoGetY(e));
break;
case 'S': /* Win WxH */
nw += snprintf(buf + nw, len - nw, "%4dx%4d",
EoGetW(e), EoGetH(e));
nw += snprintf(buf + nw, len - nw, "%4dx%4d", EoGetW(e), EoGetH(e));
break;
case 'T': /* Client WxH */
nw += snprintf(buf + nw, len - nw, "%4dx%4d",

View File

@ -52,9 +52,7 @@ void EstrInt2EncFree(const char *str, int want_utf8);
int EwcOpen(int utf8);
void EwcClose(void);
int EwcStrToWcs(const char *str, int len, wchar_t *wcs,
int wcl);
int EwcWcsToStr(const wchar_t *wcs, int wcl, char *str,
int len);
int EwcStrToWcs(const char *str, int len, wchar_t *wcs, int wcl);
int EwcWcsToStr(const wchar_t *wcs, int wcl, char *str, int len);
#endif /* _LANG_H_ */

View File

@ -593,7 +593,8 @@ ESavePrefixSetup(void)
Esnprintf(buf, sizeof(buf), "%s/%s-%d",
EDirUserConf(), Mode.conf.name, Dpy.screen);
else if (Mode.wm.window)
Esnprintf(buf, sizeof(buf), "%s/%s-window", EDirUserConf(), ECFG_DEFAULT);
Esnprintf(buf, sizeof(buf), "%s/%s-window", EDirUserConf(),
ECFG_DEFAULT);
else
Esnprintf(buf, sizeof(buf), "%s/%s-%s",
EDirUserConf(), ECFG_DEFAULT, Dpy.name);

View File

@ -134,8 +134,7 @@ struct _menu {
static void MenuRedraw(Menu * m);
static void MenuRealize(Menu * m);
static void MenuActivateItem(Menu * m, MenuItem * mi);
static void MenuDrawItem(Menu * m, MenuItem * mi, char shape,
int state);
static void MenuDrawItem(Menu * m, MenuItem * mi, char shape, int state);
static void MenuHandleEvents(Win win, XEvent * ev, void *m);
static void MenuItemHandleEvents(Win win, XEvent * ev, void *mi);
@ -335,22 +334,22 @@ MenuShow(Menu * m, char noshow)
b = BorderFind(m->style->border_name);
if (b)
{
int sx, sy, sw, sh;
Area area;
const EImageBorder *pad;
pad = BorderGetSize(b);
head_num = ScreenGetGeometryByPointer(&sx, &sy, &sw, &sh);
head_num = ScreenGetGeometryByPointer(&area);
if (wx > sx + sw - mw - pad->right)
wx = sx + sw - mw - pad->right;
if (wx < sx + pad->left)
wx = sx + pad->left;
if (wx > area.x + area.w - mw - pad->right)
wx = area.x + area.w - mw - pad->right;
if (wx < area.x + pad->left)
wx = area.x + pad->left;
if (wy > sy + sh - mh - pad->bottom)
wy = sy + sh - mh - pad->bottom;
if (wy < sy + pad->top)
wy = sy + pad->top;
if (wy > area.y + area.h - mh - pad->bottom)
wy = area.y + area.h - mh - pad->bottom;
if (wy < area.y + pad->top)
wy = area.y + pad->top;
}
}
@ -992,8 +991,7 @@ MenuDrawItem(Menu * m, MenuItem * mi, char shape, int state)
{
ImageclassApplyCopy(ic, mi->win, w, h, 0, 0, mi->state, &pmm,
IC_FLAG_MAKE_MASK);
EXCopyAreaTiled(pmm.pmap, pmm.mask, mi_pmm->pmap,
0, 0, w, h, 0, 0);
EXCopyAreaTiled(pmm.pmap, pmm.mask, mi_pmm->pmap, 0, 0, w, h, 0, 0);
PmapMaskFree(&pmm);
}
@ -1473,7 +1471,7 @@ static void
_MenusSlideCheck(Menu *m, int xo, int yo, int ww, int hh, int *pdx, int *pdy)
{
EWin *ewin;
int sx, sy, sw, sh;
Area area;
int xdist, ydist;
xdist = ydist = 0;
@ -1481,23 +1479,23 @@ _MenusSlideCheck(Menu * m, int xo, int yo, int ww, int hh, int *pdx, int *pdy)
if (!Conf.menus.onscreen)
goto done;
ScreenGetGeometryByHead(Mode_menus.first->ewin->head, &sx, &sy, &sw, &sh);
ScreenGetGeometryByHead(Mode_menus.first->ewin->head, &area);
ewin = m->ewin;
if (EoGetX(Mode_menus.first->ewin) < sx)
xdist = sx - EoGetX(Mode_menus.first->ewin);
if (EoGetX(ewin) + xdist + xo + ww > sx + sw)
xdist = sx + sw - (EoGetX(ewin) + xo + ww);
if (EoGetX(ewin) + xdist + xo < sx)
xdist = sx - (EoGetX(ewin) + xo);
if (EoGetX(Mode_menus.first->ewin) < area.x)
xdist = area.x - EoGetX(Mode_menus.first->ewin);
if (EoGetX(ewin) + xdist + xo + ww > area.x + area.w)
xdist = area.x + area.w - (EoGetX(ewin) + xo + ww);
if (EoGetX(ewin) + xdist + xo < area.x)
xdist = area.x - (EoGetX(ewin) + xo);
if (EoGetY(Mode_menus.first->ewin) < sy)
ydist = sy - EoGetY(Mode_menus.first->ewin);
if (EoGetY(ewin) + ydist + yo + hh > sy + sh)
ydist = sy + sh - (EoGetY(ewin) + yo + hh);
if (EoGetY(ewin) + ydist + yo < sy)
ydist = sy - (EoGetY(ewin) + yo);
if (EoGetY(Mode_menus.first->ewin) < area.y)
ydist = area.y - EoGetY(Mode_menus.first->ewin);
if (EoGetY(ewin) + ydist + yo + hh > area.y + area.h)
ydist = area.y + area.h - (EoGetY(ewin) + yo + hh);
if (EoGetY(ewin) + ydist + yo < area.y)
ydist = area.y - (EoGetY(ewin) + yo);
done:
*pdx = xdist;

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2022 Kim Woelders
* Copyright (C) 2004-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -252,10 +252,10 @@ _MoveResizeMoveResume(void)
if (Mode_mr.grab_server)
EGrabServer();
dx =
Mode.events.mx - Mode_mr.win_x - EoGetX(EoGetDesk(ewin)) - ewin->shape_x;
dy =
Mode.events.my - Mode_mr.win_y - EoGetY(EoGetDesk(ewin)) - ewin->shape_y;
dx = Mode.events.mx - Mode_mr.win_x - EoGetX(EoGetDesk(ewin)) -
ewin->shape_x;
dy = Mode.events.my - Mode_mr.win_y - EoGetY(EoGetDesk(ewin)) -
ewin->shape_y;
/* Redraw any windows that were in "move mode" */
lst = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE,
@ -475,8 +475,9 @@ _SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
EWin **lst, **gwins, *e;
int gnum, num, i, j, k, odx, ody;
static char last_res = 0;
int top_bound, bottom_bound, left_bound, right_bound, w, h;
int top_bound, bottom_bound, left_bound, right_bound;
int top_strut, bottom_strut, left_strut, right_strut;
Area area;
if (!ewin)
return;
@ -488,10 +489,11 @@ _SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
return;
}
ScreenGetGeometry(ewin->shape_x, ewin->shape_y,
&left_bound, &top_bound, &w, &h);
right_bound = left_bound + w;
bottom_bound = top_bound + h;
ScreenGetGeometry(ewin->shape_x, ewin->shape_y, &area);
left_bound = area.x;
top_bound = area.y;
right_bound = left_bound + area.w;
bottom_bound = top_bound + area.h;
left_strut = left_bound + Conf.place.screen_struts.left;
right_strut = right_bound - Conf.place.screen_struts.right;
@ -508,7 +510,8 @@ _SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
return;
gwins =
ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup, &gnum);
ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup,
&gnum);
if (gwins)
{
for (j = k = 0; j < num; j++)
@ -518,8 +521,7 @@ _SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
continue;
if (!EoIsSticky(e) && EoGetDesk(ewin) != EoGetDesk(e))
continue; /* Skip if other desk */
if (EoIsFloating(e) || e->state.iconified ||
e->props.ignorearrange)
if (EoIsFloating(e) || e->state.iconified || e->props.ignorearrange)
continue;
for (i = 0; i < gnum; i++)
{

View File

@ -323,7 +323,8 @@ PagerHiwinUpdate(Hiwin * phi, Pager * p __UNUSED__, EWin * ewin)
im = EImageGrabDrawable(ewin->mini_pmm.pmap, NoXID, 0, 0,
ewin->mini_pmm.w, ewin->mini_pmm.h, 0);
EImageRenderOnDrawable(im, EoGetWin(phi), 0, 0, 0, EoGetW(phi), EoGetH(phi));
EImageRenderOnDrawable(im, EoGetWin(phi), 0,
0, 0, EoGetW(phi), EoGetH(phi));
EImageDecache(im);
}
#endif
@ -488,8 +489,7 @@ doPagerUpdate(Pager * p)
EX_Picture pict, alpha;
pict = EPictureCreate(ewin->mini_pmm.depth == WinGetDepth(p->win) ?
p->win : EoGetWin(ewin),
ewin->mini_pmm.pmap);
p->win : EoGetWin(ewin), ewin->mini_pmm.pmap);
alpha = ECompMgrWinGetAlphaPict(EoObj(ewin));
XRenderComposite(disp, PictOpOver, pict, alpha, p->pict,
0, 0, 0, 0, wx, wy, ww, wh);
@ -660,7 +660,8 @@ PagerUpdateBg(Pager * p)
goto done;
}
EXPaintRectangle(pmap, 0, 0, p->dw, p->dh, Dpy.pixel_black, Dpy.pixel_white);
EXPaintRectangle(pmap, 0, 0, p->dw, p->dh,
Dpy.pixel_black, Dpy.pixel_white);
done:
#if USE_XRENDER
@ -1078,7 +1079,8 @@ PagerMenuShow(Pager * p, int x, int y)
MenuAddItem(m, mi);
if (Conf_pagers.hiq)
mi = MenuItemCreate(_("High Quality Off"), NULL, "pg hiq off", NULL);
mi = MenuItemCreate(_("High Quality Off"), NULL, "pg hiq off",
NULL);
else
mi = MenuItemCreate(_("High Quality On"), NULL, "pg hiq on", NULL);
MenuAddItem(m, mi);
@ -1910,7 +1912,8 @@ _DlgFillPagers(Dialog * d, DItem * table, void *data __UNUSED__)
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Zoom in on pager windows when mouse is over them"));
DialogItemSetText(di,
_("Zoom in on pager windows when mouse is over them"));
DialogItemCheckButtonSetPtr(di, &dd->pager_zoom);
di = DialogAddItem(table, DITEM_CHECKBUTTON);

View File

@ -71,7 +71,8 @@ ProgressbarCreate(const char *name, int w, int h)
p->win = EobjWindowCreate(EOBJ_TYPE_MISC, x, y, w - (h * 5), h, 1, name);
p->n_win =
EobjWindowCreate(EOBJ_TYPE_MISC, x + w - (h * 5), y, (h * 5), h, 1, "pn");
EobjWindowCreate(EOBJ_TYPE_MISC, x + w - (h * 5), y, (h * 5), h, 1,
"pn");
p->p_win = EobjWindowCreate(EOBJ_TYPE_MISC, x, y + h, 1, h, 1, "pp");
if (!p->win || !p->n_win || !p->p_win)
{
@ -157,7 +158,8 @@ ProgressbarSet(Progressbar * p, int progress)
EClearWindow(EobjGetWin(p->n_win));
TextDraw(p->tnc, EobjGetWin(p->n_win), NoXID, 0, 0, STATE_CLICKED, s,
pad->left, pad->top, p->h * 5 - (pad->left + pad->right),
p->h - (pad->top + pad->bottom), TextclassGetJustification(p->tnc));
p->h - (pad->top + pad->bottom),
TextclassGetJustification(p->tnc));
/* Hack - We may not be running in the event loop here */
EobjDamage(p->n_win);
@ -180,5 +182,6 @@ ProgressbarShow(Progressbar * p)
TextDraw(p->tc, EobjGetWin(p->win), NoXID, 0, 0, STATE_NORMAL,
EobjGetName(p->win), pad->left, pad->top,
p->w - (p->h * 5) - (pad->left + pad->right),
p->h - (pad->top + pad->bottom), TextclassGetJustification(p->tnc));
p->h - (pad->top + pad->bottom),
TextclassGetJustification(p->tnc));
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2003-2022 Kim Woelders
* Copyright (C) 2003-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -300,31 +300,25 @@ ScreenShowInfo(const char *prm __UNUSED__)
}
void
ScreenGetGeometryByHead(int head, int *px, int *py, int *pw, int *ph)
ScreenGetGeometryByHead(int head, Area *pa)
{
EScreen *ps;
int x, y, w, h;
if (head >= 0 && head < n_screens)
{
ps = p_screens + head;
x = ps->x;
y = ps->y;
w = ps->w;
h = ps->h;
pa->x = ps->x;
pa->y = ps->y;
pa->w = ps->w;
pa->h = ps->h;
}
else
{
x = 0;
y = 0;
w = WinGetW(VROOT);
h = WinGetH(VROOT);
pa->x = 0;
pa->y = 0;
pa->w = WinGetW(VROOT);
pa->h = WinGetH(VROOT);
}
*px = x;
*py = y;
*pw = w;
*ph = h;
}
int
@ -363,18 +357,18 @@ ScreenGetHead(int xi, int yi)
}
int
ScreenGetGeometry(int xi, int yi, int *px, int *py, int *pw, int *ph)
ScreenGetGeometry(int xi, int yi, Area *pa)
{
int head;
head = ScreenGetHead(xi, yi);
ScreenGetGeometryByHead(head, px, py, pw, ph);
ScreenGetGeometryByHead(head, pa);
return head;
}
static void
_VRootGetAvailableArea(int *px, int *py, int *pw, int *ph)
_VRootGetAvailableArea(Area *pa)
{
EWin *const *lst, *ewin;
int i, num, l, r, t, b;
@ -385,6 +379,7 @@ _VRootGetAvailableArea(int *px, int *py, int *pw, int *ph)
b = Conf.place.screen_struts.bottom;
lst = EwinListGetAll(&num);
for (i = 0; i < num; i++)
{
ewin = lst[i];
@ -399,59 +394,53 @@ _VRootGetAvailableArea(int *px, int *py, int *pw, int *ph)
b = ewin->strut.bottom;
}
*px = l;
*py = t;
*pw = WinGetW(VROOT) - (l + r);
*ph = WinGetH(VROOT) - (t + b);
pa->x = l;
pa->y = t;
pa->w = WinGetW(VROOT) - (l + r);
pa->h = WinGetH(VROOT) - (t + b);
}
int
ScreenGetAvailableArea(int xi, int yi, int *px, int *py, int *pw, int *ph,
int ignore_struts)
ScreenGetAvailableArea(int xi, int yi, Area *pa, int ignore_struts)
{
int x1, y1, w1, h1, x2, y2, w2, h2, head;
int head;
Area area; /* Available */
head = ScreenGetGeometry(xi, yi, &x1, &y1, &w1, &h1);
head = ScreenGetGeometry(xi, yi, pa);
if (!ignore_struts)
{
_VRootGetAvailableArea(&x2, &y2, &w2, &h2);
if (x1 < x2)
x1 = x2;
if (y1 < y2)
y1 = y2;
if (w1 > w2)
w1 = w2;
if (h1 > h2)
h1 = h2;
}
_VRootGetAvailableArea(&area);
if (pa->x < area.x)
pa->x = area.x;
if (pa->y < area.y)
pa->y = area.y;
if (pa->w > area.w)
pa->w = area.w;
if (pa->h > area.h)
pa->h = area.h;
*px = x1;
*py = y1;
*pw = w1;
*ph = h1;
}
return head;
}
int
ScreenGetGeometryByPointer(int *px, int *py, int *pw, int *ph)
ScreenGetGeometryByPointer(Area *pa)
{
int pointer_x, pointer_y;
EQueryPointer(NULL, &pointer_x, &pointer_y, NULL, NULL);
return ScreenGetGeometry(pointer_x, pointer_y, px, py, pw, ph);
return ScreenGetGeometry(pointer_x, pointer_y, pa);
}
int
ScreenGetAvailableAreaByPointer(int *px, int *py, int *pw, int *ph,
int ignore_struts)
ScreenGetAvailableAreaByPointer(Area *pa, int ignore_struts)
{
int pointer_x, pointer_y;
EQueryPointer(NULL, &pointer_x, &pointer_y, NULL, NULL);
return ScreenGetAvailableArea(pointer_x, pointer_y, px, py, pw, ph,
ignore_struts);
return ScreenGetAvailableArea(pointer_x, pointer_y, pa, ignore_struts);
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2016 Kim Woelders
* Copyright (C) 2004-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -29,16 +29,11 @@ void ScreenSplit(unsigned int nx, unsigned int ny);
void ScreenShowInfo(const char *prm);
int ScreenGetCurrent(void);
int ScreenGetHead(int xi, int yi);
int ScreenGetGeometry(int x, int y, int *px, int *py,
int *pw, int *ph);
void ScreenGetGeometryByHead(int head, int *px, int *py,
int *pw, int *ph);
int ScreenGetAvailableArea(int x, int y, int *px, int *py,
int *pw, int *ph, int ignore_struts);
int ScreenGetGeometryByPointer(int *px, int *py,
int *pw, int *ph);
int ScreenGetAvailableAreaByPointer(int *px, int *py,
int *pw, int *ph,
int ScreenGetGeometry(int x, int y, Area * pa);
void ScreenGetGeometryByHead(int head, Area * pa);
int ScreenGetAvailableArea(int x, int y, Area * pa,
int ignore_struts);
int ScreenGetGeometryByPointer(Area * pa);
int ScreenGetAvailableAreaByPointer(Area * pa, int ignore_struts);
#endif /* _SCREEN_H_ */

View File

@ -512,8 +512,8 @@ doSMExit(int mode, const char *params)
if (Mode.wm.single)
l += Esnprintf(s + l, sizeof(s) - l, " -s %d", Dpy.screen);
else if (!Mode.wm.master)
l +=
Esnprintf(s + l, sizeof(s) - l, " -m %d", Mode.wm.master_screen);
l += Esnprintf(s + l, sizeof(s) - l, " -m %d",
Mode.wm.master_screen);
if (Mode.wm.window)
l += Esnprintf(s + l, sizeof(s) - l, " -w %dx%d",
WinGetW(VROOT), WinGetH(VROOT));

View File

@ -461,7 +461,8 @@ _DlgFillPlacement(Dialog * d, DItem * table, void *data __UNUSED__)
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Ignore struts/panels when windows are fullscreen"));
DialogItemSetText(di,
_("Ignore struts/panels when windows are fullscreen"));
DialogItemCheckButtonSetPtr(di, &dd->place_ignore_struts_fullscreen);
di = DialogAddItem(table, DITEM_CHECKBUTTON);

View File

@ -239,8 +239,9 @@ SetupX(const char *dstr)
}
Mode.masks.mod_key_mask =
(ShiftMask | ControlMask | Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask |
Mod5Mask) & (~(numlock | scrollock | LockMask));
(ShiftMask | ControlMask |
Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask) &
(~(numlock | scrollock | LockMask));
if (mod)
XFreeModifiermap(mod);

View File

@ -473,8 +473,7 @@ pareto_maximizer(EWin * ewin, int type, EWin * const *lst, int num,
if (done_stacking_flag[i])
{
Dprintf("no stacked constraint from #%d %s\n", i,
EwinGetTitle(pe));
Dprintf("no stacked constraint from #%d %s\n", i, EwinGetTitle(pe));
continue;
}
@ -501,7 +500,8 @@ pareto_maximizer(EWin * ewin, int type, EWin * const *lst, int num,
constraints_bl = EMALLOC(point, num * 5);
constraints_br = ECALLOC(point, num * 5);
if (!constraints_tl || !constraints_tr || !constraints_bl || !constraints_br)
if (!constraints_tl || !constraints_tr ||
!constraints_bl || !constraints_br)
goto freedom;
for (i = 1; i < num; i++)
@ -738,8 +738,7 @@ pareto_maximizer(EWin * ewin, int type, EWin * const *lst, int num,
ld++;
}
new_w = 1 - ld + rd;
trim =
new_w - (int)(new_h * ewin->icccm.aspect_min);
trim = new_w - (int)(new_h * ewin->icccm.aspect_min);
}
while (trim > 0);
Dprintf("ld now %d, rd now %d\n", ld, rd);
@ -761,8 +760,7 @@ pareto_maximizer(EWin * ewin, int type, EWin * const *lst, int num,
td++;
}
new_h = 1 - td + bd;
trim =
new_h - (int)(new_w / ewin->icccm.aspect_min);
trim = new_h - (int)(new_w / ewin->icccm.aspect_min);
}
while (trim > 0);
Dprintf("ld now %d, rd now %d\n", ld, rd);
@ -817,6 +815,7 @@ void
MaxSizeHV(EWin *ewin, const char *resize_type, int hor, int ver, int flags)
{
int x, y, w, h, x1, x2, y1, y2, type, bl, br, bt, bb;
Area area;
EWin *const *lst;
int num, speed;
int old_hor = ewin->state.maximized_horz != 0;
@ -938,10 +937,12 @@ MaxSizeHV(EWin * ewin, const char *resize_type, int hor, int ver, int flags)
case MAX_HALF_S:
case MAX_HALF_E:
case MAX_HALF_W:
ScreenGetAvailableArea(x + w / 2, y + h / 2, &x1, &y1, &x2, &y2,
ScreenGetAvailableArea(x + w / 2, y + h / 2, &area,
Conf.place.ignore_struts_maximize);
x2 += x1;
y2 += y1;
x1 = area.x;
y1 = area.y;
x2 = x1 + area.w;
y2 = y1 + area.h;
if (Conf.movres.dragbar_nocover && type != MAX_ABSOLUTE)
{

View File

@ -203,8 +203,8 @@ EwinsSlideTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
for (i = 0; i < num_wins; i++)
{
an =
EwinSlideTo(ewin[i], fx[i], fy[i], tx[i], ty[i], speed, mode, flags);
an = EwinSlideTo(ewin[i], fx[i], fy[i], tx[i], ty[i], speed, mode,
flags);
flags |= SLIDE_SOUND;
}

View File

@ -34,8 +34,7 @@ void EobjSlideSizeTo(EObj * eo, int fx, int fy, int tx, int ty,
#define SLIDE_WARP (1 << 2)
Animator *EwinSlideSizeTo(EWin * ewin, int tx, int ty,
int tw, int th,
int speed, int mode, int flags);
int tw, int th, int speed, int mode, int flags);
Animator *EwinSlideTo(EWin * ewin, int fx, int fy, int tx, int ty,
int speed, int mode, int flags);
Animator *EwinsSlideTo(EWin ** ewin, int *fx, int *fy,

View File

@ -286,10 +286,11 @@ _SnapEwinGet(EWin * ewin, unsigned int match_flags)
/* Set the snap name. Has no particular significance. */
if ((sn->win_name || sn->win_class) && sn->win_role)
Esnprintf(buf, sizeof(buf), "%s.%s:%s", ST(sn->win_name),
ST(sn->win_class), sn->win_role);
Esnprintf(buf, sizeof(buf), "%s.%s:%s",
ST(sn->win_name), ST(sn->win_class), sn->win_role);
else if (sn->win_name || sn->win_class)
Esnprintf(buf, sizeof(buf), "%s.%s", ST(sn->win_name), ST(sn->win_class));
Esnprintf(buf, sizeof(buf), "%s.%s",
ST(sn->win_name), ST(sn->win_class));
else if (sn->win_title)
Esnprintf(buf, sizeof(buf), "TITLE.%s", sn->win_title);
else /* We should not go here */
@ -1108,7 +1109,8 @@ SnapshotsSaveReal(void)
if (sn->use_flags & SNAP_USE_SIZE)
fprintf(f, "WH: %i %i\n", sn->w, sn->h);
if (sn->use_flags & SNAP_USE_POS)
fprintf(f, "XY: %i %i %i %i\n", sn->x, sn->y, sn->area_x, sn->area_y);
fprintf(f, "XY: %i %i %i %i\n",
sn->x, sn->y, sn->area_x, sn->area_y);
if (sn->use_flags & SNAP_USE_LAYER)
fprintf(f, "LAYER: %i\n", sn->layer);
if (sn->use_flags & SNAP_USE_STICKY)
@ -1650,7 +1652,8 @@ _SnapShow(void *data, void *prm)
#define SU(sn, item) ((sn->match_flags & item) ? '>' : ':')
if (sn->used)
Esnprintf(buf, sizeof(buf), "In use - %#x", EwinGetClientXwin(sn->used));
Esnprintf(buf, sizeof(buf), "In use - %#x",
EwinGetClientXwin(sn->used));
else
Esnprintf(buf, sizeof(buf), "*** Unused ***");
IpcPrintf(" Snapshot Name: %s %s\n", name, buf);

View File

@ -512,8 +512,7 @@ _SoundSighan(int sig, void *prm __UNUSED__)
static char tmp_audio;
static void
_Dlg_ApplySound(Dialog * d __UNUSED__, int val __UNUSED__,
void *data __UNUSED__)
_Dlg_ApplySound(Dialog *d __UNUSED__, int val __UNUSED__, void *data __UNUSED__)
{
_SoundConfigure(tmp_audio);
autosave();

View File

@ -188,8 +188,8 @@ _sound_pulse_Destroy(Sample * s)
if (pa_ctx && s->name)
{
op =
pa_context_remove_sample(pa_ctx, s->name, context_op_callback, NULL);
op = pa_context_remove_sample(pa_ctx, s->name,
context_op_callback, NULL);
if (op)
pa_operation_unref(op);
dispatch(-1);

View File

@ -423,7 +423,8 @@ SystrayInit(Container * ct)
E_XA__XEMBED = ex_atom_get("_XEMBED");
E_XA__XEMBED_INFO = ex_atom_get("_XEMBED_INFO");
_NET_SYSTEM_TRAY_OPCODE = ex_atom_get("_NET_SYSTEM_TRAY_OPCODE");
_NET_SYSTEM_TRAY_MESSAGE_DATA = ex_atom_get("_NET_SYSTEM_TRAY_MESSAGE_DATA");
_NET_SYSTEM_TRAY_MESSAGE_DATA =
ex_atom_get("_NET_SYSTEM_TRAY_MESSAGE_DATA");
/* Acquire selection */
if (systray_sel)

View File

@ -104,9 +104,9 @@ void TextstateTextDraw(TextState * ts, Win win,
int x, int y, int w, int h,
const EImageBorder * pad,
int justh, int justv);
void TextSize(TextClass * tclass, int active, int sticky,
int state, const char *text,
int *width, int *height);
void TextSize(TextClass * tclass,
int active, int sticky, int state,
const char *text, int *width, int *height);
void TextDraw(TextClass * tclass, Win win, EX_Drawable draw,
int active, int sticky, int state,
const char *text, int x, int y, int w, int h,

View File

@ -157,8 +157,7 @@ _ift_TextSize(TextState * ts, const char *text, int len,
}
static void
_ift_TextDraw(TextState * ts, int x, int y, const char *text,
int len __UNUSED__)
_ift_TextDraw(TextState *ts, int x, int y, const char *text, int len __UNUSED__)
{
FontCtxIft *fdc = (FontCtxIft *) ts->fdc;

View File

@ -103,8 +103,8 @@ _xft_TextSize(TextState * ts, const char *text, int len,
*ascent = fdc->font->ascent;
#if 0
Eprintf("asc/dsc/h=%d/%d/%d x,y=%2d,%d wxh=%dx%d ox,y=%3d,%d: (%d)%s\n",
fdc->font->ascent, fdc->font->descent, fdc->font->height, gi.x, gi.y,
gi.width, gi.height, gi.xOff, gi.yOff, len, text);
fdc->font->ascent, fdc->font->descent, fdc->font->height,
gi.x, gi.y, gi.width, gi.height, gi.xOff, gi.yOff, len, text);
#endif
}

View File

@ -204,7 +204,8 @@ TimersRunNextIn(unsigned int t_ms)
* The (mean) amount of work done in a timer function should of course not
* exceed the timeout time. */
if (timer)
dt = (int)(timer->at_time - t_ms) > 0 ? (int)(timer->at_time - t_ms) : 1;
dt = (int)(timer->at_time - t_ms) > 0 ?
(int)(timer->at_time - t_ms) : 1;
else
dt = 0;

View File

@ -619,8 +619,7 @@ TooltipShow(ToolTip * tt, const char *text, ActionClass * ac, int x, int y)
if (ActionGetEvent(aa) == EVENT_DOUBLE_DOWN)
{
TextDraw(tt->tclass, EobjGetWin(tt->TTWIN), tt->pmap4,
0, 0, STATE_NORMAL, "2x",
xx, ytxt, double_w, htxt, 0);
0, 0, STATE_NORMAL, "2x", xx, ytxt, double_w, htxt, 0);
}
xx += double_w;

Some files were not shown because too many files have changed in this diff Show More