Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/icewm-1-4-BRANCH' into icewm-1…
Browse files Browse the repository at this point in the history
…-4-BRANCH
  • Loading branch information
gijsbers committed Nov 2, 2023
2 parents bb673f5 + ca1e2f0 commit b921aae
Show file tree
Hide file tree
Showing 21 changed files with 221 additions and 81 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ AC_SUBST([GIO_CFLAGS])
AC_SUBST([GIO_LIBS])

AC_ARG_ENABLE([rsvg],
AS_HELP_STRING([--disable-rsvg],[Disable SVG using librsvg.]))
AS_HELP_STRING([--disable-librsvg],[Disable SVG using librsvg.]))
AC_ARG_ENABLE([imlib2],
AS_HELP_STRING([--disable-imlib2],[Disable imlib2 rendering.
@<:@default=enabled@:>@]))
Expand Down Expand Up @@ -417,7 +417,7 @@ then
fi

if test "x$enable_nanosvg" != xyes &&
test "x$enable_rsvg" != xno
test "x$enable_librsvg" != xno
then
PKG_CHECK_MODULES([LIBRSVG],[librsvg-2.0],[
IMAGE_CFLAGS="$LIBRSVG_CFLAGS $IMAGE_CFLAGS"
Expand Down
51 changes: 37 additions & 14 deletions contrib/icewm-menu-xrandr
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ $xrandr.=" --verbose";
sub strip_tfield
{
my $name = substr($_[0], $_[1], 13);
print "heh: $name\n" if $debug > 4;
print "# Raw name: $name\n" if $debug > 4;
$name=~s/^\W.*//;
$name=~s/(\r|\n|\0).*//;
$name=~s/\W$//;
print "Decoded: $name\n" if $debug > 2;
print "# Decoded: $name\n" if $debug > 2;
return $name;
}

Expand All @@ -94,13 +94,14 @@ sub load_ini
next if ! -r $_;
my $fd;
my %cfg;
if (open($fd, "<$_"))

{
{
my %cfg=( "sectype" => "main");
push(@cfiledata, \%cfg);
}
my %cfg=( "sectype" => "main");
push(@cfiledata, \%cfg);
}

if (open($fd, "<$_"))
{
for (<$fd>)
{
s/^\s+//;
Expand Down Expand Up @@ -174,9 +175,19 @@ sub match_output
{
my $output = shift;
my @ret = ();
#print Dumper("# cfiledata:", @cfiledata) if $debug > 4;

if (! scalar @cfiledata)
{
return @ret;
}

for my $xr (@cfiledata)
{
next unless ($$xr{"sectype"} eq "main" || $$xr{"sectype"} eq "output");
#print "# What is this?".Dumper("# $xr -> ", $xr) if $debug > 5;
my $st = $$xr{"sectype"};
next if !defined($st);
next unless ($st eq "main" || $st eq "output");

my $fil = $$xr{"match-name"};
if (defined($fil))
Expand Down Expand Up @@ -232,7 +243,9 @@ sub pick_for_combo
my $val;
for my $xr (@cfiledata)
{
next unless ($$xr{"sectype"} eq "main" || $$xr{"sectype"} eq "combo");
my $st = $$xr{"sectype"};
next if ! defined($st);
next unless ($st eq "main" || $st eq "combo");
my $fil = ($$xr{"match-name"} or $$xr{"match-label"});
if (defined($fil))
{
Expand Down Expand Up @@ -271,39 +284,46 @@ sub read_xrandr
{
print "# DBG: $_" if $debug > 4;
my $resFound =/(\d+x\d+\++\d)/;
# compressed, non-verbose output
if(/^(\w\S*)\s+(connected|disconnected)\s+(primary)?/)
{
# parse state helper var
$curmon = $1;
$prim = $curmon if $3;
# print "# heh? $1 - $2 - $3 - $4\n";
print "# curmon hit? $1 - $2 - ".(defined($3) ? $3 : "")."\n" if $debug > 4;
# disconnected and also no active resolution set!
$disabled = ($2 eq "disconnected") && !$resFound;
if($disabled)
{
print "# marked as disabled: $curmon\n" if $debug > 4;
#$turnRestOff.=" --display $curmon --off";
}
else
{
print "# add as connected: $curmon" if $debug > 4;
push(@connected, $curmon);
}
}

# consider active only when there is a flag in the resolution list...
$active{$curmon} = (/^\s.*\*current/ && !$disabled) if $curmon;

if (defined($currentEdid)) {
# print "# consider: $curmon" if $debug > 4;
if (defined($currentEdid))
{
if (/:/) # now analyze and stop merging
{
parse_edid($currentEdid, $curmon);
undef $currentEdid;
}
else {
else
{
/(\w+)/;
$currentEdid .= $1;
}
}
elsif (/EDID:/) {
elsif (/EDID:/)
{
$currentEdid = "";
}
}
Expand Down Expand Up @@ -392,6 +412,9 @@ sub add_conf
my $newPrim = $cmdHints[0];
my %dedup;
my @xcmds;

print "add_conf: $showname, $icon, $cmd, $postCmdHint" if $debug > 4;

for my $involved (@cmdHints)
{
print "# affected: $involved\n" if $debug;
Expand Down Expand Up @@ -450,7 +473,7 @@ sub run
[$prim, $sec]
);
add_conf(nameOf($sec)." + ".nameOf($prim, 1), "setscreen21",
ajoin(fmtOutputMode($sec), loc($sec), fmtOutputMode($prim), $priFlag, loc($prim, $lof, $sec), $killRest),
ajoin(fmtOutputMode($sec), loc($sec), fmtOutputMode($prim), $priFlag, loc($prim, $rof, $sec), $killRest),
[$prim, $sec]);
add_conf(nameOf($prim)." + ".nameOf($sec, 1), "setscreen12x",
ajoin(fmtOutputMode($prim), loc($prim), fmtOutputMode($sec), $priFlag, loc($sec, $rof, $prim), $killRest),
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.5)
PROJECT(ICEWM CXX)

#
Expand Down
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.5)
PROJECT(ICEWM CXX)

#
Expand Down
10 changes: 3 additions & 7 deletions lib/winoptions.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
xterm.XTerm.icon: xterm
rxvt.icon: xterm
nxterm.icon: xterm
fte.icon: fte
emacs.Emacs.icon: emacs
AWTapp.icon: java

# plank with picom
#plank.doNotManage: 1

# make Evince resizable
evince.dBorder: 1
Expand All @@ -28,11 +29,6 @@ xeyes.ignoreNoFocusHint: 1
XClock.ignoreNoFocusHint: 1
Vim.icon: vim

applix.ignoreNoFocusHint: 1
XDdts.noFocusOnAppRaise: 1
Wingz.noFocusOnAppRaise: 1
WingzPro.noFocusOnAppRaise: 1

gkrellm.Gkrellm.allWorkspaces: 1
gkrellm.Gkrellm.ignoreTaskBar: 1
gkrellm.Gkrellm.layer: Below
Expand Down
12 changes: 6 additions & 6 deletions man/icewm-prefoverride.pod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

=head2 NAME

icewm-prefoverride - icewm override preferences configuration file
icewm-prefoverride - override themable preferences file

=head2 SYNOPSIS

Expand All @@ -15,11 +15,11 @@
=head2 DESCRIPTION

Settings that override the settings from a theme. Some of the B<icewm>
configuration options from the preferences file that control the
look-and-feel may be overridden by the theme, if the theme designer
thinks this is desirable. However, this F<prefoverride> file will again
override this for a few specific options of your choosing. It is safe
to leave this file empty initially.
preferences that control the look may be set by the theme.
However, the settings in this F<prefoverride> file override that.
It is safe to leave this file empty initially.
Note that this file is meant for themable preferences and a few icewm
startup settings cannot be set here, like C<Splash>.

=head2 FILES

Expand Down
2 changes: 1 addition & 1 deletion po/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.5)
PROJECT(ICEWM CXX)

# yes, FindGettext.cmake exists but it's not really handy :-(
Expand Down
6 changes: 3 additions & 3 deletions po/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: icewm 1.3.4pre2\n"
"Report-Msgid-Bugs-To: https://github.com/bbidulock/icewm/issues\n"
"POT-Creation-Date: 2023-07-21 01:44+0200\n"
"PO-Revision-Date: 2023-04-27 02:14+0000\n"
"PO-Revision-Date: 2023-10-04 23:15+0000\n"
"Last-Translator: Luiz Fernando Ranghetti <[email protected]>\n"
"Language-Team: Portuguese (Brazil) <https://l10n.opensuse.org/projects/icewm/"
"icewm-1-4-branch/pt_BR/>\n"
Expand Down Expand Up @@ -2043,7 +2043,7 @@ msgstr "S_uspender"

#: src/wmapp.cc:528 src/wmdialog.cc:91
msgid "_Hibernate"
msgstr ""
msgstr "_Hibernar"

#: src/wmapp.cc:532
msgid "Restart _Icewm"
Expand Down Expand Up @@ -2293,7 +2293,7 @@ msgstr ""

#: src/wmapp.cc:1617
msgid " -o, --output=FILE Redirect all output to FILE.\n"
msgstr ""
msgstr " -o, --output=ARQUIVO Redireciona toda as saídas para o ARQUIVO.\n"

#: src/wmapp.cc:1622
#, c-format
Expand Down
2 changes: 0 additions & 2 deletions rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ if [[ -v DBGCM ]]; then
-DCONFIG_NANOSVG=$NSV \
-DCONFIG_XRANDR=ON \
-DCONFIG_XPM=ON \
-DCMAKE_CXX_COMPILER_ID=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX="$prefix" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DICEHELPIDX="$prefix/share/doc/icewm-common/html/icewm.html" \
Expand Down
7 changes: 4 additions & 3 deletions src/aworkspaces.cc
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,14 @@ void WorkspaceButton::paint(Graphics &g, const YRect& r) {
}

ref<YIcon> icon;
const bool dark = surface.color.isDark();
YColor colors[] = {
surface.color,
surface.color.brighter(),
surface.color.darker(),
dark ? surface.color.darker() : surface.color.brighter(),
dark ? surface.color.brighter() : surface.color.darker(),
getColor(),
YColor(), // getColor().brighter(),
getColor().darker()
dark ? getColor().brighter() : getColor().darker()
};

for (YFrameWindow *yfw = manager->bottomLayer(WinLayerBelow);
Expand Down
32 changes: 21 additions & 11 deletions src/icesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3705,18 +3705,28 @@ void IceSh::loadIcon(Window window, char* file)
{
int fd = open(file, O_RDONLY);
if (0 <= fd) {
char head[128];
int width = 0, height = 0, depth = 0, maxval = 0, length = 0;
if (read(fd, head, sizeof head) == ssize_t(sizeof head) &&
strncmp(head, "P7\nWIDTH ", 9) == 0 &&
sscanf(head,
"P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\n"
"MAXVAL %d\nTUPLTYPE RGB_ALPHA\nENDHDR\n%n",
&width, &height, &depth, &maxval, &length) == 4 &&
0 < width && width <= 256 &&
0 < height && height <= 256 &&
depth == 4 && maxval == 255 && 64 <= length)
const int headlen = 512;
char head[headlen + 2], *ptr;
int width = 0, height = 0, depth = 0, maxval = 0;
const size_t len = read(fd, head, headlen);
if (len > 3 && strncmp(head, "P7\n", 3) == 0 &&
(head[len] = '\0') == '\0' &&
(ptr = strstr(head, "\nWIDTH ")) != nullptr &&
sscanf(ptr + 7, "%d", &width) == 1 &&
(ptr = strstr(head, "\nHEIGHT ")) != nullptr &&
sscanf(ptr + 8, "%d", &height) == 1 &&
(ptr = strstr(head, "\nDEPTH ")) != nullptr &&
sscanf(ptr + 7, "%d", &depth) == 1 &&
(ptr = strstr(head, "\nMAXVAL ")) != nullptr &&
sscanf(ptr + 8, "%d", &maxval) == 1 &&
(ptr = strstr(head, "\nTUPLTYPE ")) != nullptr &&
strncmp(ptr + 10, "RGB_ALPHA\n", 10) == 0 &&
(ptr = strstr(head, "\nENDHDR\n")) != nullptr &&
inrange(width, 1, 256) &&
inrange(height, 1, 256) &&
depth == 4 && maxval == 255)
{
ssize_t length = (ptr + 8 - head);
unsigned* data = new unsigned[width * height];
size_t size = sizeof(unsigned) * width * height;
memset(data, 0, size);
Expand Down
7 changes: 4 additions & 3 deletions src/iceview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class FileView: public YDndWindow {
void loadFile() {
mstring ext(path.getExtension().lower());
if (ext == ".xpm" || ext == ".png" || ext == ".svg" ||
ext == ".jpg" || ext == ".jpeg")
ext == ".jpg" || ext == ".jpeg" || ext == ".webp")
{
ref<YImage> image = YImage::load(path);
if (image != null) {
Expand All @@ -651,15 +651,16 @@ class FileView: public YDndWindow {
max(height(), image->height()));
}
}
else printf("Cannot load %s.\n", path.string());
}
else
{
char* buf = path.loadText();
fcsmart buf(path.loadText());
if (buf) {
int len = strlen(buf);
setSize(max(width(), 80 * unsigned(view->getFontWidth())),
max(height(), 30 * unsigned(view->getFontHeight())));
view->setData(buf, len);
view->setData(buf.release(), len);
}
}
}
Expand Down
Loading

0 comments on commit b921aae

Please sign in to comment.