New upstream version 1.1.7

parent b46ef1ec
Makefile.config
config.h
*.o
*.dep
trayer
trayer changelog
1.1.7
* Library cleanup
* Icon Spacing
1.1.6
* react on monitor setup changes
......
......@@ -3,7 +3,7 @@ Installation:
1. Default way
Most users (99.99%) should use this way :-)
./confugire
./configure
make
su -
make install
......
......@@ -18,7 +18,7 @@ endif
TARGET = trayer
$(TARGET): $(OBJ)
$(TARGET): $(OBJ)
$(CC) $(LDFLAGS) $(OBJ) -o $@ $(LIBS)
ifeq (,$(DEVEL))
strip $@
......@@ -30,12 +30,12 @@ all: $(TARGET)
clean:
$(RM) $(TARGET) $(OBJ) $(DEP) *~
distclean:
distclean:
rm -f Makefile.config config.h
install:
install -d $(PREFIX)/bin
install -m 755 $(TARGET) $(PREFIX)/bin
install:
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin
uninstall:
rm -f $(PREFIX)/bin/$(TARGET)
rm -f $(DESTDIR)$(PREFIX)/bin/$(TARGET)
......@@ -16,8 +16,10 @@ endif
endif
CC ?= gcc
LIBS = $(shell pkg-config --libs gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0) -lX11 -L/usr/X11R6/lib -lXmu
INCS = $(shell pkg-config --cflags gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0)
PKG_CONFIG ?= pkg-config
LIBS = $(shell $(PKG_CONFIG) --libs gtk+-2.0 gdk-pixbuf-2.0 x11)
INCS = $(shell $(PKG_CONFIG) --cflags gtk+-2.0 gdk-pixbuf-2.0 x11)
CFLAGS ?= -O2 -Wall
ifneq (,$(DEVEL))
CFLAGS ?= -g -Wall
......
PREFIX:=/usr
DEVEL:=
......@@ -53,20 +53,25 @@ OPTIONS
--monitor - define the mointor on which you like trayer to appear,
number of zero to number of monitors minus one,
or the string "primary".
--iconspacing - Space between tray icons in pixels.
TRAYER IN DISTROS
debian
git://git.debian.org/git/collab-maint/trayer
https://packages.debian.org/source/jessie/trayer
ubuntu
http://packages.ubuntu.com/xenial/trayer
fedora
https://github.com/bryanbickford/trayer
archlinux
http://github.com/sargon/trayer-srg
https://aur.archlinux.org/packages/trayer-srg-git/
gentoo
http://packages.gentoo.org/package/x11-misc/trayer-srg
nixos
http://hydra.nixos.org/job/nixpkgs/trunk/trayer.i686-linux/latest
http://hydra.nixos.org/job/nixpkgs/trunk/trayer.x86_64-linux/latest
AUTHORS
Maciej Delmanowski <harnir@users.berlios.de>
......@@ -84,3 +89,6 @@ AUTHORS
Vladimir Murzin - fixing transparency startup problem
Corey Richardson - Found some default value fuckup
Constantine Verutin - React on changes in monitor setup.
Robbie Harwood - Fixup build
Omar Sandoval - Fixups
Harri Nieminen - Fixup library linking
//created by ./configure script
#define PREFIX "/usr"
#!/usr/bin/env bash
PREFIX=/usr
if [ ! -z "$1" ]; then
if [[ "$1" =~ ^--prefix= ]]; then
PREFIX=$(echo $1 | cut -d= -f2)
else
echo "Usage: $0 [--prefix=<path>]"
exit 1
fi
fi
if [ -f config.h ]; then
echo "overwriting old config.h..."
fi
cat > config.h <<EOF
/* created by ./configure */
#define PREFIX $PREFIX
EOF
if [ -f Makefile.config ]; then
echo "overwriting old Makefile.config..."
fi
cat > Makefile.config <<EOF
# created by ./configure
PREFIX = $PREFIX
EOF
......@@ -2,7 +2,6 @@
#include <unistd.h>
#include <string.h>
#include <X11/Xmu/WinUtil.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "panel.h"
......@@ -87,6 +86,7 @@ tray_constructor(panel *p)
tr->panel = p;
tr->mainw = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
tr->box = p->my_box_new(FALSE, 1);
gtk_box_set_spacing(GTK_BOX(tr->box), p->icon_spacing);
gtk_container_add (GTK_CONTAINER (tr->mainw), tr->box);
gtk_container_add(GTK_CONTAINER(p->box), tr->mainw);
......
......@@ -187,8 +187,10 @@ fix build problems, improvements cmdline parameter handling
primary switch for monitor selection
.IP "Vladimir Murzin <murzin.v@gmail.com>"
fixing transparency startup problem
.IP "Corey Richardson <corey@octayn.net>"
.IP "Corey Richardson <corey@octayn.net>" Found some default value fuckup
.IP "Constantine Verutin" React on changes in monitor setup.
.IP "Robbie Harwood" Fixup build
.IP "Omar Sandoval" Fixups
.SH AUTHOR
This man page is written by Daniel Ehlers.
......@@ -401,7 +401,7 @@ get_net_wm_state(Window win, net_wm_state *nws)
ENTER;
bzero(nws, sizeof(nws));
memset(nws, 0, sizeof(*nws));
if (!(state = get_xaproperty(win, a_NET_WM_STATE, XA_ATOM, &num3)))
RET();
......@@ -442,7 +442,7 @@ get_net_wm_window_type(Window win, net_wm_window_type *nwwt)
ENTER;
bzero(nwwt, sizeof(nwwt));
memset(nwwt, 0, sizeof(*nwwt));
if (!(state = get_xaproperty(win, a_NET_WM_WINDOW_TYPE, XA_ATOM, &num3)))
RET();
......
......@@ -93,7 +93,7 @@ panel_set_wm_strut(panel *p)
default:
ERR("wrong edge %d. strut won't be set\n", p->edge);
RET();
}
}
DBG("type %d. width %d. from %d to %d\n", i, data[i], data[4 + i*2], data[5 + i*2]);
XChangeProperty(gdk_helper_display(), p->topxwin, a_NET_WM_STRUT_PARTIAL,
......@@ -105,7 +105,7 @@ panel_set_wm_strut(panel *p)
RET();
}
static GdkFilterReturn
static GdkFilterReturn
panel_wm_events(GdkXEvent *xevent, GdkEvent *event, panel *p)
{
Atom at;
......@@ -135,7 +135,7 @@ panel_wm_events(GdkXEvent *xevent, GdkEvent *event, panel *p)
****************************************************/
static gint
static gint
panel_delete_event(GtkWidget * widget, GdkEvent * event, gpointer data)
{
ENTER;
......@@ -146,7 +146,7 @@ static gint
panel_destroy_event(GtkWidget * widget, GdkEvent * event, gpointer data)
{
ENTER;
// TODO need to cleanup
// TODO need to cleanup
gtk_main_quit();
RET(FALSE);
}
......@@ -326,7 +326,7 @@ panel_start_gui(panel *p)
gdk_window_stick ( p->topGdkWindow);
gdk_window_set_skip_pager_hint ( p->topGdkWindow, True );
gdk_window_set_skip_taskbar_hint ( p->topGdkWindow, True );
gdk_window_set_skip_taskbar_hint ( p->topGdkWindow, True );
XSelectInput (gdk_helper_display(), GDK_ROOT_WINDOW(), PropertyChangeMask);
XSelectInput (gdk_helper_display(), p->topxwin, PropertyChangeMask | FocusChangeMask | StructureNotifyMask);
......@@ -336,7 +336,8 @@ panel_start_gui(panel *p)
gdk_window_move_resize(p->topgwin->window, p->ax, p->ay, p->aw, p->ah);
if (p->setstrut)
panel_set_wm_strut(p);
if (p->lower)
XLowerWindow(gdk_helper_display(), p->topxwin);
RET();
}
......@@ -359,12 +360,12 @@ panel_parse_global(panel *p)
p->heighttype = HEIGHT_PIXEL;
if (p->heighttype == HEIGHT_PIXEL) {
if (p->height < PANEL_HEIGHT_MIN) {
ERR( "height is bound by %i pixels\n", PANEL_HEIGHT_MIN );
ERR( "height is bound by %i pixels\n", PANEL_HEIGHT_MIN );
p->height = PANEL_HEIGHT_MIN;
} else if (p->height > PANEL_HEIGHT_MAX) {
ERR( "height is bound by %i pixels\n", PANEL_HEIGHT_MAX );
} else if (p->height > PANEL_HEIGHT_MAX) {
ERR( "height is bound by %i pixels\n", PANEL_HEIGHT_MAX );
p->height = PANEL_HEIGHT_MAX;
}
}
}
panel_start_gui(p);
RET(1);
......@@ -403,8 +404,9 @@ usage()
ENTER;
printf("trayer %s - lightweight GTK2+ systray for UNIX desktops\n", version);
printf("Command line options:\n");
printf(" -h -- print this help and exit:\n");
printf(" -v -- print version and exit:\n");
printf(" -h -- print this help and exit\n");
printf(" -v -- print version and exit\n");
printf(" -l -- lower the window on startup\n");
printf(" --edge <left|right|top|bottom|none> (default:bottom) \n");
printf(" --align <left|right|center> (default:center)\n");
printf(" --margin <number> (default:0)\n");
......@@ -417,13 +419,14 @@ usage()
printf(" --transparent <true|false> (default:false)\n");
printf(" --alpha <number> (default:127)\n");
printf(" --tint <int> (default:0xFFFFFFFF)\n");
printf(" --distance <number> (default:0)\n");
printf(" --distance <number> (default:0)\n");
printf(" --distancefrom <left|right|top|bottom> (default:top) \n");
printf(" --expand <false|true> (default:true)\n");
printf(" --padding <number> (default:0)\n");
printf(" --monitor <number|primary> (default:0)\n");
printf(" --iconspacing <number> (default:0)\n");
}
void
handle_error(Display * d, XErrorEvent * ev)
{
......@@ -441,11 +444,11 @@ main(int argc, char *argv[], char *env[])
int i;
ENTER;
setlocale(LC_CTYPE, "");
setlocale(LC_CTYPE, "");
gtk_init(&argc, &argv);
XSetLocaleModifiers("");
XSetLocaleModifiers("");
XSetErrorHandler((XErrorHandler) handle_error);
// resolve xatoms
// resolve xatoms
resolve_atoms();
p = g_new0(panel, 1);
......@@ -459,6 +462,7 @@ main(int argc, char *argv[], char *env[])
p->setdocktype = 1;
p->setstrut = 0;
p->transparent = 0;
p->icon_spacing = 0;
p->alpha = 127;
p->tintcolor = 0xFFFFFFFF;
p->xtopbg = None;
......@@ -473,6 +477,8 @@ main(int argc, char *argv[], char *env[])
} else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
printf("trayer %s\n", version);
exit(0);
} else if (!strcmp(argv[i], "-l")) {
p->lower = 1;
} else if (!strcmp(argv[i], "--edge")) {
i++;
if (i == argc) {
......@@ -630,6 +636,15 @@ main(int argc, char *argv[], char *env[])
p->on_primary = 1;
}
}
} else if (!strcmp(argv[i], "--iconspacing")) {
i++;
if (i == argc) {
ERR( "trayer: missing icon padding parameter value\n");
usage();
exit(1);
} else {
p->icon_spacing = atoi(argv[i]);
}
} else {
printf("trayer: unknown option - %s\n", argv[i]);
usage();
......
......@@ -24,17 +24,17 @@ enum { POS_NONE, POS_START, POS_END };
typedef struct {
GtkWidget *topgwin; /* main panel window */
GdkWindow* topGdkWindow; // and it parent gdk window
GdkWindow* topGdkWindow; // and it parent gdk window
Window topxwin; /* and it X window */
GtkWidget *lbox; /* primary layout box */
GtkWidget *box; /* box that contains all plugins */
GtkWidget *(*my_box_new) (gboolean, gint);
Pixmap xtopbg;
Pixmap xtopbg;
GdkPixmap *gtopbg;
int alpha;
guint32 tintcolor;
int ax, ay, aw, ah; /* actual location and size of a panel */
int allign, edge, margin;
int orientation;
......@@ -47,15 +47,17 @@ typedef struct {
int transparent : 1;
int on_primary : 1;
int monitor;
int icon_spacing;
// Import from plugin structure
gpointer priv;
gpointer priv;
int expand;
int padding;
int lower;
} panel;
typedef struct {
typedef struct {
unsigned int modal : 1;
unsigned int sticky : 1;
unsigned int maximized_vert : 1;
......@@ -69,7 +71,7 @@ typedef struct {
unsigned int below : 1;
} net_wm_state;
typedef struct {
typedef struct {
unsigned int desktop : 1;
unsigned int dock : 1;
unsigned int toolbar : 1;
......@@ -114,12 +116,12 @@ extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
extern Atom a_NET_WM_DESKTOP;
extern Atom a_NET_WM_NAME;
extern Atom a_NET_WM_STRUT;
extern Atom a_NET_WM_STRUT_PARTIAL;
extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment