summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--doc/Eterm.1.in8
-rw-r--r--src/options.c9
-rw-r--r--src/options.h1
-rw-r--r--src/startup.c2
-rw-r--r--src/startup.h2
-rw-r--r--src/windows.c6
7 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6555739..6a70d8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5522,3 +5522,8 @@ Wed Oct 18 13:35:18 2006 Michael Jennings (mej)
Fixed a typo and some logic errors in libscream located by Mike
Frysinger <vapier@gentoo.org>.
----------------------------------------------------------------------
+Mon Oct 30 16:11:47 2006 Michael Jennings (mej)
+
+Patch from Jason McCarver <slam@parasite.cc> to support -S/--sticky
+option for "sticky" (i.e., present on all desktops) startup.
+----------------------------------------------------------------------
diff --git a/doc/Eterm.1.in b/doc/Eterm.1.in
index 9c3ca42..f55f580 100644
--- a/doc/Eterm.1.in
+++ b/doc/Eterm.1.in
@@ -457,6 +457,9 @@ Display the scrollbar only when the Eterm window is focused.
.BR "\-x", " \-\-borderless"
This option forces Eterm to have no borders.
.TP
+.BR "\-S", " \-\-sticky"
+Start Eterm as a sticky window (shows on all desktops)
+.TP
.BR "\-m", " \-\-map-alert"
Un-iconify on beep.
.TP
@@ -1734,6 +1737,11 @@ If true (default), any colored text (that is, any text not rendered
using the default foreground color) will not be given any other
special treatment for bolding (e.g., bold font or bold overstrike).
.RE
+
+.BI sticky " boolean"
+.RS 5
+If true, Eterm will make its window sticky (shows on all desktops).
+.RE
.RE
.TP
diff --git a/src/options.c b/src/options.c
index 8f44852..802a473 100644
--- a/src/options.c
+++ b/src/options.c
@@ -305,6 +305,7 @@ spifopt_t option_list[] = {
SPIFOPT_BOOL_LONG("blink-brightens-background", "\"blink\" attribute brightens background color", vt_options,
VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND),
SPIFOPT_BOOL_LONG("colors-suppress-bold", "do not make ANSI colors 0-16 bold", vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD),
+ SPIFOPT_BOOL('S', "sticky", "start window sticky", eterm_options, ETERM_OPTIONS_STICKY),
#ifndef NO_MAPALERT
# ifdef MAPALERT_OPTION
SPIFOPT_BOOL('m', "map-alert", "uniconify on beep", vt_options, VT_OPTIONS_MAP_ALERT),
@@ -1278,6 +1279,13 @@ parse_toggles(char *buff, void *state)
BITFIELD_CLEAR(vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD);
}
+ } else if (!BEG_STRCASECMP(buff, "sticky ")) {
+ if (bool_val) {
+ BITFIELD_SET(eterm_options, ETERM_OPTIONS_STICKY);
+ } else {
+ BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_STICKY);
+ }
+
} else {
libast_print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context toggles\n", file_peek_path(),
file_peek_line(), buff);
@@ -3823,6 +3831,7 @@ save_config(char *path, unsigned char save_theme)
fprintf(fp, " itrans %d\n", (BITFIELD_IS_SET(image_options, IMAGE_OPTIONS_ITRANS) ? 1 : 0));
fprintf(fp, " buttonbar %d\n", ((buttonbar && bbar_is_visible(buttonbar)) ? 1 : 0));
fprintf(fp, " resize_gravity %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_RESIZE_GRAVITY) ? 1 : 0));
+ fprintf(fp, " sticky %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_STICKY) ? 1 : 0));
fprintf(fp, "end toggles\n\n");
fprintf(fp, "begin keyboard\n");
diff --git a/src/options.h b/src/options.h
index f158aab..04ea6d2 100644
--- a/src/options.h
+++ b/src/options.h
@@ -61,6 +61,7 @@
# define ETERM_OPTIONS_DOUBLE_BUFFER (1LU << 15)
# define ETERM_OPTIONS_MBYTE_CURSOR (1LU << 16)
# define ETERM_OPTIONS_RESIZE_GRAVITY (1LU << 17)
+# define ETERM_OPTIONS_STICKY (1LU << 18)
# define IMAGE_OPTIONS_TRANS (1U << 0)
# define IMAGE_OPTIONS_ITRANS (1U << 1)
diff --git a/src/startup.c b/src/startup.c
index 145050c..bbece55 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -153,6 +153,8 @@ eterm_bootstrap(int argc, char *argv[])
props[PROP_EWMH_ICON] = XInternAtom(Xdisplay, "_NET_WM_ICON", False);
props[PROP_EWMH_OPACITY] = XInternAtom(Xdisplay, "_NET_WM_WINDOW_OPACITY", True);
props[PROP_EWMH_STARTUP_ID] = XInternAtom(Xdisplay, "_NET_STARTUP_ID", False);
+ props[PROP_EWMH_STATE] = XInternAtom(Xdisplay, "_NET_WM_STATE", False);
+ props[PROP_EWMH_STATE_STICKY] = XInternAtom(Xdisplay, "_NET_WM_STATE_STICKY", False);
if ((theme_dir = spifconf_parse_theme(&rs_theme, THEME_CFG, PARSE_TRY_ALL)) != NULL) {
char *tmp;
diff --git a/src/startup.h b/src/startup.h
index fc3708c..83b868f 100644
--- a/src/startup.h
+++ b/src/startup.h
@@ -106,6 +106,8 @@ enum {
PROP_EWMH_ICON,
PROP_EWMH_OPACITY,
PROP_EWMH_STARTUP_ID,
+ PROP_EWMH_STATE,
+ PROP_EWMH_STATE_STICKY,
NUM_PROPS
};
diff --git a/src/windows.c b/src/windows.c
index c0c6435..dd45022 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -498,6 +498,12 @@ Create_Windows(int argc, char *argv[])
XChangeProperty(Xdisplay, TermWin.parent, props[PROP_DESKTOP], XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &val, 1);
}
+ /* Make window sticky if requested */
+ if (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_STICKY)) {
+ XChangeProperty(Xdisplay, TermWin.parent, props[PROP_EWMH_STATE], XA_ATOM, 32, PropModeReplace,
+ (unsigned char *) &props[PROP_EWMH_STATE_STICKY], 1);
+ }
+
/* Set startup ID property if given by the launching application. */
if (getenv("DESKTOP_STARTUP_ID")) {
Atom atom;