Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
feh
Commits
82206405
Commit
82206405
authored
9 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
adjust coding style in patch, always free gc, coherent HAVE_LIBXINERAMA wrapping
parent
740daf5c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/options.c
+1
-1
1 addition, 1 deletion
src/options.c
src/wallpaper.c
+24
-36
24 additions, 36 deletions
src/wallpaper.c
with
25 additions
and
37 deletions
src/options.c
+
1
−
1
View file @
82206405
...
...
@@ -70,8 +70,8 @@ void init_parse_options(int argc, char **argv)
#ifdef HAVE_LIBXINERAMA
/* if we're using xinerama, then enable it by default */
opt
.
xinerama
=
1
;
#endif
/* HAVE_LIBXINERAMA */
opt
.
xinerama_index
=
-
1
;
#endif
/* HAVE_LIBXINERAMA */
feh_getopt_theme
(
argc
,
argv
);
...
...
This diff is collapsed.
Click to expand it.
src/wallpaper.c
+
24
−
36
View file @
82206405
...
...
@@ -304,17 +304,17 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
char
filbuf
[
4096
];
char
*
bgfill
=
NULL
;
bgfill
=
opt
.
image_bg
==
IMAGE_BG_WHITE
?
"--image-bg white"
:
"--image-bg black"
;
if
(
opt
.
xinerama
)
{
if
(
opt
.
xinerama_index
>=
0
)
{
#ifdef HAVE_LIBXINERAMA
if
(
opt
.
xinerama
)
{
if
(
opt
.
xinerama_index
>=
0
)
{
snprintf
(
fehbg_args
,
sizeof
(
fehbg_args
),
"--xinerama-index %d"
,
opt
.
xinerama_index
);
}
}
else
snprintf
(
fehbg_args
,
sizeof
(
fehbg_args
),
"--no-xinerama"
);
#endif
/* HAVE_LIBXINERAMA */
/* local display to set closedownmode on */
Display
*
disp2
;
...
...
@@ -366,22 +366,19 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
pmap_d1
=
XCreatePixmap
(
disp
,
root
,
scr
->
width
,
scr
->
height
,
depth
);
#ifdef HAVE_LIBXINERAMA
if
(
opt
.
xinerama_index
>=
0
)
{
if
(
opt
.
xinerama_index
>=
0
)
{
if
(
opt
.
image_bg
==
IMAGE_BG_WHITE
)
gcval
.
foreground
=
WhitePixel
(
disp
,
DefaultScreen
(
disp
));
else
gcval
.
foreground
=
BlackPixel
(
disp
,
DefaultScreen
(
disp
));
gc
=
XCreateGC
(
disp
,
root
,
GCForeground
,
&
gcval
);
XFillRectangle
(
disp
,
pmap_d1
,
gc
,
0
,
0
,
scr
->
width
,
scr
->
height
);
XFreeGC
(
disp
,
gc
);
}
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
feh_wm_set_bg_scaled
(
pmap_d1
,
im
,
use_filelist
,
xinerama_screens
[
i
].
x_org
,
xinerama_screens
[
i
].
y_org
,
xinerama_screens
[
i
].
width
,
xinerama_screens
[
i
].
height
);
...
...
@@ -406,12 +403,9 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
XFillRectangle
(
disp
,
pmap_d1
,
gc
,
0
,
0
,
scr
->
width
,
scr
->
height
);
#ifdef HAVE_LIBXINERAMA
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
feh_wm_set_bg_centered
(
pmap_d1
,
im
,
use_filelist
,
xinerama_screens
[
i
].
x_org
,
xinerama_screens
[
i
].
y_org
,
xinerama_screens
[
i
].
width
,
xinerama_screens
[
i
].
height
);
...
...
@@ -432,22 +426,19 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
pmap_d1
=
XCreatePixmap
(
disp
,
root
,
scr
->
width
,
scr
->
height
,
depth
);
#ifdef HAVE_LIBXINERAMA
if
(
opt
.
xinerama_index
>=
0
)
{
if
(
opt
.
xinerama_index
>=
0
)
{
if
(
opt
.
image_bg
==
IMAGE_BG_WHITE
)
gcval
.
foreground
=
WhitePixel
(
disp
,
DefaultScreen
(
disp
));
else
gcval
.
foreground
=
BlackPixel
(
disp
,
DefaultScreen
(
disp
));
gc
=
XCreateGC
(
disp
,
root
,
GCForeground
,
&
gcval
);
XFillRectangle
(
disp
,
pmap_d1
,
gc
,
0
,
0
,
scr
->
width
,
scr
->
height
);
XFreeGC
(
disp
,
gc
);
}
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
feh_wm_set_bg_filled
(
pmap_d1
,
im
,
use_filelist
,
xinerama_screens
[
i
].
x_org
,
xinerama_screens
[
i
].
y_org
,
xinerama_screens
[
i
].
width
,
xinerama_screens
[
i
].
height
);
...
...
@@ -472,12 +463,9 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
XFillRectangle
(
disp
,
pmap_d1
,
gc
,
0
,
0
,
scr
->
width
,
scr
->
height
);
#ifdef HAVE_LIBXINERAMA
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
if
(
opt
.
xinerama
&&
xinerama_screens
)
{
for
(
i
=
0
;
i
<
num_xinerama_screens
;
i
++
)
{
if
(
opt
.
xinerama_index
<
0
||
opt
.
xinerama_index
==
i
)
{
feh_wm_set_bg_maxed
(
pmap_d1
,
im
,
use_filelist
,
xinerama_screens
[
i
].
x_org
,
xinerama_screens
[
i
].
y_org
,
xinerama_screens
[
i
].
width
,
xinerama_screens
[
i
].
height
);
...
...
@@ -524,7 +512,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
}
}
if
(
fehbg
)
free
(
fehbg
);
free
(
fehbg
);
/* create new display, copy pixmap to new display */
disp2
=
XOpenDisplay
(
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment