Remove global variables from header files
git-svn-id: http://tint2.googlecode.com/svn/trunk@671 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
1a3ba21245
commit
d584d04691
7 changed files with 21 additions and 21 deletions
|
@ -128,7 +128,7 @@ target_link_libraries( tint2 m )
|
|||
|
||||
add_dependencies( tint2 version )
|
||||
set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -pthread" )
|
||||
set_target_properties(tint2 PROPERTIES LINK_FLAGS "-pthread" )
|
||||
set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread" )
|
||||
|
||||
install( TARGETS tint2 DESTINATION bin )
|
||||
install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
|
||||
|
|
11
src/config.c
11
src/config.c
|
@ -35,6 +35,10 @@
|
|||
#include <pango/pangoxft.h>
|
||||
#include <Imlib2.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef TINT2CONF
|
||||
|
||||
#include "common.h"
|
||||
#include "server.h"
|
||||
#include "panel.h"
|
||||
|
@ -44,7 +48,6 @@
|
|||
#include "systraybar.h"
|
||||
#include "launcher.h"
|
||||
#include "clock.h"
|
||||
#include "config.h"
|
||||
#include "window.h"
|
||||
#include "tooltip.h"
|
||||
#include "timer.h"
|
||||
|
@ -53,10 +56,14 @@
|
|||
#include "battery.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// global path
|
||||
char *config_path;
|
||||
char *snapshot_path;
|
||||
|
||||
#ifndef TINT2CONF
|
||||
|
||||
// --------------------------------------------------
|
||||
// backward compatibility
|
||||
// detect if it's an old config file (==1)
|
||||
|
@ -780,5 +787,5 @@ int config_read_file (const char *path)
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
|
||||
#include "server.h"
|
||||
#include "config.h"
|
||||
#include "task.h"
|
||||
#include "window.h"
|
||||
|
||||
Server_global server;
|
||||
|
||||
void server_catch_error (Display *d, XErrorEvent *ev){}
|
||||
|
||||
void server_init_atoms ()
|
||||
|
@ -350,6 +351,10 @@ next:
|
|||
}
|
||||
}
|
||||
|
||||
int server_get_number_of_desktop ()
|
||||
{
|
||||
return get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL);
|
||||
}
|
||||
|
||||
void get_desktops()
|
||||
{
|
||||
|
|
|
@ -130,7 +130,7 @@ typedef struct
|
|||
} Server_global;
|
||||
|
||||
|
||||
Server_global server;
|
||||
extern Server_global server;
|
||||
|
||||
|
||||
// freed memory
|
||||
|
|
14
src/tint.c
14
src/tint.c
|
@ -128,19 +128,14 @@ void init (int argc, char *argv[])
|
|||
#ifdef HAVE_SN
|
||||
static int error_trap_depth = 0;
|
||||
|
||||
static void
|
||||
error_trap_push (SnDisplay *display,
|
||||
Display *xdisplay)
|
||||
static void error_trap_push(SnDisplay *display, Display *xdisplay)
|
||||
{
|
||||
++error_trap_depth;
|
||||
}
|
||||
|
||||
static void
|
||||
error_trap_pop (SnDisplay *display,
|
||||
Display *xdisplay)
|
||||
static void error_trap_pop(SnDisplay *display, Display *xdisplay)
|
||||
{
|
||||
if (error_trap_depth == 0)
|
||||
{
|
||||
if (error_trap_depth == 0) {
|
||||
fprintf(stderr, "Error trap underflow!\n");
|
||||
return;
|
||||
}
|
||||
|
@ -157,8 +152,7 @@ static void sigchld_handler(int sig) {
|
|||
ctx = (SnLauncherContext *) g_tree_lookup (server.pids, GINT_TO_POINTER (pid));
|
||||
if (ctx == NULL) {
|
||||
fprintf(stderr, "Unknown child %d terminated!\n", pid);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
g_tree_remove (server.pids, GINT_TO_POINTER (pid));
|
||||
sn_launcher_context_complete (ctx);
|
||||
sn_launcher_context_unref (ctx);
|
||||
|
|
|
@ -197,11 +197,6 @@ int window_is_skip_taskbar (Window win)
|
|||
}
|
||||
|
||||
|
||||
int server_get_number_of_desktop ()
|
||||
{
|
||||
return get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL);
|
||||
}
|
||||
|
||||
|
||||
GSList *server_get_name_of_desktop ()
|
||||
{
|
||||
|
|
|
@ -17,7 +17,6 @@ void set_active (Window win);
|
|||
void set_desktop (int desktop);
|
||||
void set_close (Window win);
|
||||
int server_get_current_desktop ();
|
||||
int server_get_number_of_desktop ();
|
||||
GSList *server_get_name_of_desktop ();
|
||||
int window_is_iconified (Window win);
|
||||
int window_is_urgent (Window win);
|
||||
|
|
Loading…
Reference in a new issue