add support for the X Cursor library. this means a nicer cursor for startup notification.
This commit is contained in:
parent
59c5d1cc4e
commit
c567f5937b
3 changed files with 46 additions and 22 deletions
|
@ -105,6 +105,7 @@ parser_libobparser_la_SOURCES = \
|
||||||
|
|
||||||
openbox_openbox_CPPFLAGS = \
|
openbox_openbox_CPPFLAGS = \
|
||||||
$(X_CFLAGS) \
|
$(X_CFLAGS) \
|
||||||
|
$(XCURSOR_CFLAGS) \
|
||||||
$(SM_CFLAGS) \
|
$(SM_CFLAGS) \
|
||||||
$(PANGO_CFLAGS) \
|
$(PANGO_CFLAGS) \
|
||||||
$(GLIB_CFLAGS) \
|
$(GLIB_CFLAGS) \
|
||||||
|
@ -122,6 +123,7 @@ openbox_openbox_LDADD = \
|
||||||
$(XSHAPE_LIBS) \
|
$(XSHAPE_LIBS) \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
$(X_LIBS) \
|
$(X_LIBS) \
|
||||||
|
$(XCURSOR_LIBS) \
|
||||||
$(LIBSN_LIBS) \
|
$(LIBSN_LIBS) \
|
||||||
$(XML_LIBS) \
|
$(XML_LIBS) \
|
||||||
$(EFENCE_LIBS) \
|
$(EFENCE_LIBS) \
|
||||||
|
|
13
configure.ac
13
configure.ac
|
@ -107,6 +107,18 @@ else
|
||||||
sn_found=no
|
sn_found=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(XCURSOR, [xcursor],
|
||||||
|
[
|
||||||
|
AC_DEFINE(USE_XCURSOR, [1], [Use X Cursor library])
|
||||||
|
AC_SUBST(XCURSOR_CFLAGS)
|
||||||
|
AC_SUBST(XCURSOR_LIBS)
|
||||||
|
xcursor_found=yes
|
||||||
|
],
|
||||||
|
[
|
||||||
|
xcursor_found=no
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
dnl Check for session management
|
dnl Check for session management
|
||||||
X11_SM
|
X11_SM
|
||||||
|
|
||||||
|
@ -133,6 +145,7 @@ AC_OUTPUT
|
||||||
AC_MSG_RESULT
|
AC_MSG_RESULT
|
||||||
AC_MSG_RESULT([Compiling with these options:
|
AC_MSG_RESULT([Compiling with these options:
|
||||||
Startup Notification... $sn_found
|
Startup Notification... $sn_found
|
||||||
|
X Cursor Library... $xcursor_found
|
||||||
Session Management... $SM
|
Session Management... $SM
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT([configure complete, now type "make"])
|
AC_MSG_RESULT([configure complete, now type "make"])
|
||||||
|
|
|
@ -70,6 +70,9 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <X11/cursorfont.h>
|
#include <X11/cursorfont.h>
|
||||||
|
#if USE_XCURSOR
|
||||||
|
#include <X11/Xcursor/Xcursor.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
RrInstance *ob_rr_inst;
|
RrInstance *ob_rr_inst;
|
||||||
RrTheme *ob_rr_theme;
|
RrTheme *ob_rr_theme;
|
||||||
|
@ -91,6 +94,7 @@ static gboolean being_replaced = FALSE;
|
||||||
|
|
||||||
static void signal_handler(gint signal, gpointer data);
|
static void signal_handler(gint signal, gpointer data);
|
||||||
static void parse_args(gint argc, gchar **argv);
|
static void parse_args(gint argc, gchar **argv);
|
||||||
|
static Cursor load_cursor(const gchar *name, guint fontval);
|
||||||
|
|
||||||
gint main(gint argc, gchar **argv)
|
gint main(gint argc, gchar **argv)
|
||||||
{
|
{
|
||||||
|
@ -174,28 +178,21 @@ gint main(gint argc, gchar **argv)
|
||||||
|
|
||||||
/* create available cursors */
|
/* create available cursors */
|
||||||
cursors[OB_CURSOR_NONE] = None;
|
cursors[OB_CURSOR_NONE] = None;
|
||||||
cursors[OB_CURSOR_POINTER] =
|
cursors[OB_CURSOR_POINTER] = load_cursor("left_ptr", XC_left_ptr);
|
||||||
XCreateFontCursor(ob_display, XC_left_ptr);
|
cursors[OB_CURSOR_BUSY] = load_cursor("left_ptr_watch", XC_watch);
|
||||||
cursors[OB_CURSOR_BUSY] =
|
cursors[OB_CURSOR_MOVE] = load_cursor("fleur", XC_fleur);
|
||||||
XCreateFontCursor(ob_display, XC_watch);
|
cursors[OB_CURSOR_NORTH] = load_cursor("top_side", XC_top_side);
|
||||||
cursors[OB_CURSOR_MOVE] =
|
cursors[OB_CURSOR_NORTHEAST] = load_cursor("top_right_corner",
|
||||||
XCreateFontCursor(ob_display, XC_fleur);
|
XC_top_right_corner);
|
||||||
cursors[OB_CURSOR_NORTH] =
|
cursors[OB_CURSOR_EAST] = load_cursor("right_side", XC_right_side);
|
||||||
XCreateFontCursor(ob_display, XC_top_side);
|
cursors[OB_CURSOR_SOUTHEAST] = load_cursor("bottom_right_corner",
|
||||||
cursors[OB_CURSOR_NORTHEAST] =
|
XC_bottom_right_corner);
|
||||||
XCreateFontCursor(ob_display, XC_top_right_corner);
|
cursors[OB_CURSOR_SOUTH] = load_cursor("bottom_side", XC_bottom_side);
|
||||||
cursors[OB_CURSOR_EAST] =
|
cursors[OB_CURSOR_SOUTHWEST] = load_cursor("bottom_left_corner",
|
||||||
XCreateFontCursor(ob_display, XC_right_side);
|
XC_bottom_left_corner);
|
||||||
cursors[OB_CURSOR_SOUTHEAST] =
|
cursors[OB_CURSOR_WEST] = load_cursor("left_side", XC_left_side);
|
||||||
XCreateFontCursor(ob_display, XC_bottom_right_corner);
|
cursors[OB_CURSOR_NORTHWEST] = load_cursor("top_left_corner",
|
||||||
cursors[OB_CURSOR_SOUTH] =
|
XC_top_left_corner);
|
||||||
XCreateFontCursor(ob_display, XC_bottom_side);
|
|
||||||
cursors[OB_CURSOR_SOUTHWEST] =
|
|
||||||
XCreateFontCursor(ob_display, XC_bottom_left_corner);
|
|
||||||
cursors[OB_CURSOR_WEST] =
|
|
||||||
XCreateFontCursor(ob_display, XC_left_side);
|
|
||||||
cursors[OB_CURSOR_NORTHWEST] =
|
|
||||||
XCreateFontCursor(ob_display, XC_top_left_corner);
|
|
||||||
|
|
||||||
/* create available keycodes */
|
/* create available keycodes */
|
||||||
keys[OB_KEY_RETURN] =
|
keys[OB_KEY_RETURN] =
|
||||||
|
@ -440,6 +437,18 @@ static void parse_args(gint argc, gchar **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Cursor load_cursor(const gchar *name, guint fontval)
|
||||||
|
{
|
||||||
|
Cursor c = None;
|
||||||
|
|
||||||
|
#if USE_XCURSOR
|
||||||
|
c = XcursorLibraryLoadCursor(ob_display, name);
|
||||||
|
#endif
|
||||||
|
if (c == None)
|
||||||
|
XCreateFontCursor(ob_display, fontval);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
void ob_exit_with_error(const gchar *msg)
|
void ob_exit_with_error(const gchar *msg)
|
||||||
{
|
{
|
||||||
g_critical(msg);
|
g_critical(msg);
|
||||||
|
|
Loading…
Reference in a new issue