all repos — openbox @ ea481338b5f16fd81a7b33e036ead39b918a51af

openbox fork - make it a bit more like ryudo

make the obt library branch compile again with all the changes merged in from backport
Dana Jansens danakj@orodu.net
commit

ea481338b5f16fd81a7b33e036ead39b918a51af

parent

8439c393d8c1dfb7db5cebd57d2e1e084e60234a

M obt/keyboard.cobt/keyboard.c

@@ -197,7 +197,7 @@ return i;

return 0; } -const gchar *obt_keyboard_keycode_to_string(guint keycode) +gchar *obt_keyboard_keycode_to_string(guint keycode) { KeySym sym; const gchar *ret = NULL;

@@ -211,7 +211,7 @@ gunichar obt_keyboard_keycode_to_unichar(guint keycode)

{ gunichar unikey = 0; - const char *key; + char *key; if ((key = obt_keyboard_keycode_to_string(keycode)) != NULL && /* don't accept keys that aren't a single letter, like "space" */ key[1] == '\0')
M obt/keyboard.hobt/keyboard.h

@@ -59,7 +59,7 @@ valgrind. */

KeyCode obt_keyboard_keysym_to_keycode(KeySym sym); /*! Give the string form of a KeyCode */ -const gchar *obt_keyboard_keycode_to_string(guint keycode); +gchar *obt_keyboard_keycode_to_string(guint keycode); /*! Translate a KeyCode to the unicode character it represents */ gunichar obt_keyboard_keycode_to_unichar(guint keycode);
M obt/mainloop.cobt/mainloop.c

@@ -536,7 +536,7 @@ static void insert_timer(ObtMainLoop *loop, ObtMainLoopTimer *ins)

{ GSList *it; for (it = loop->timers; it; it = g_slist_next(it)) { - ObMainLoopTimer *t = it->data; + ObtMainLoopTimer *t = it->data; if (timecompare(&ins->timeout, &t->timeout) <= 0) { loop->timers = g_slist_insert_before(loop->timers, it, ins); break;

@@ -553,7 +553,7 @@ gpointer data,

GEqualFunc cmp, GDestroyNotify notify) { - ObMainLoopTimer *t = g_new(ObMainLoopTimer, 1); + ObtMainLoopTimer *t = g_new(ObtMainLoopTimer, 1); g_assert(microseconds > 0); /* if it's 0 it'll cause an infinite loop */
M obt/prop.hobt/prop.h

@@ -267,10 +267,10 @@ (obt_prop_message(screen, about, OBT_PROP_ATOM(msgtype), \

data0, data1, data2, data3, data4, \ SubstructureNotifyMask | SubstructureRedirectMask)) -#define OBT_PROP_MSG(to, about, msgtype, data0, data1, data2, data3, \ - data4, mask) \ - (obt_prop_message_to(to, OBT_PROP_ATOM(msgtype), \ - data0, data1, data2, data3, data4, mask)) +#define OBT_PROP_MSG_TO(to, about, msgtype, data0, data1, data2, data3, \ + data4, mask) \ + (obt_prop_message_to(to, about, OBT_PROP_ATOM(msgtype), \ + data0, data1, data2, data3, data4, mask)) G_END_DECLS
M openbox/client.copenbox/client.c

@@ -783,8 +783,8 @@ }

/* these should not be left on the window ever. other window managers don't necessarily use them and it will mess them up (like compiz) */ - PROP_ERASE(self->window, net_wm_visible_name); - PROP_ERASE(self->window, net_wm_visible_icon_name); + OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_NAME); + OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_ICON_NAME); /* update the list hints */ client_set_list();

@@ -1528,7 +1528,7 @@ else if (proto[i] == OBT_PROP_ATOM(WM_TAKE_FOCUS))

/* if this protocol is requested, then the window will be notified whenever we want it to receive focus */ self->focus_notify = TRUE; - else if (proto[i] == prop_atoms.net_wm_ping) + else if (proto[i] == OBT_PROP_ATOM(NET_WM_PING)) /* if this protocol is requested, then the window will allow pings to determine if it is still alive */ self->ping = TRUE;

@@ -2282,7 +2282,7 @@ g_free(s);

/* see if it has the PID set too (the PID requires that the WM_CLIENT_MACHINE be set) */ - if (PROP_GET32(self->window, net_wm_pid, cardinal, &pid)) + if (OBT_PROP_GET32(self->window, NET_WM_PID, CARDINAL, &pid)) self->pid = pid; } }

@@ -3240,8 +3240,8 @@ client_kill(self);

else /* request the client to close with WM_DELETE_WINDOW */ OBT_PROP_MSG_TO(self->window, self->window, WM_PROTOCOLS, - OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime, 0, 0, - NoEventMask); + OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime, + 0, 0, 0, NoEventMask); } void client_kill(ObClient *self)
M openbox/config.copenbox/config.c

@@ -226,7 +226,7 @@ x_pos_given = TRUE;

} if (x_pos_given && (c = obt_parse_find_node(n->children, "y"))) - if (!obt_parse_node_contains("default", doc, c)) { + if (!obt_parse_node_contains(c, "default")) { config_parse_gravity_coord(c, &settings->position.y); settings->pos_given = TRUE; }
M openbox/event.copenbox/event.c

@@ -644,8 +644,7 @@ else if (e->type == MappingNotify) {

/* keyboard layout changes for modifier mapping changes. reload the modifier map, and rebind all the key bindings as appropriate */ ob_debug("Kepboard map changed. Reloading keyboard bindings.\n"); - modkeys_shutdown(TRUE); - modkeys_startup(TRUE); + obt_keyboard_reload(); keyboard_rebind(); } else if (e->type == ClientMessage) {

@@ -769,8 +768,8 @@ else if (e->xclient.data.l[0] == 2)

ob_restart(); else if (e->xclient.data.l[0] == 3) ob_exit(0); - } else if (msgtype == prop_atoms.wm_protocols) { - if ((Atom)e->xclient.data.l[0] == prop_atoms.net_wm_ping) + } else if (msgtype == OBT_PROP_ATOM(WM_PROTOCOLS)) { + if ((Atom)e->xclient.data.l[0] == OBT_PROP_ATOM(NET_WM_PING)) ping_got_pong(e->xclient.data.l[1]); } break;
M openbox/openbox.copenbox/openbox.c

@@ -40,7 +40,6 @@ #include "grab.h"

#include "group.h" #include "config.h" #include "ping.h" -#include "mainloop.h" #include "gettext.h" #include "render/render.h" #include "render/theme.h"
M openbox/ping.copenbox/ping.c

@@ -19,11 +19,11 @@ */

#include "ping.h" #include "client.h" -#include "prop.h" #include "event.h" #include "debug.h" -#include "mainloop.h" #include "openbox.h" +#include "obt/mainloop.h" +#include "obt/prop.h" typedef struct _ObPingTarget {

@@ -78,8 +78,8 @@ t = g_new0(ObPingTarget, 1);

t->client = client; t->h = h; - ob_main_loop_timeout_add(ob_main_loop, PING_TIMEOUT, ping_timeout, - t, g_direct_equal, NULL); + obt_main_loop_timeout_add(ob_main_loop, PING_TIMEOUT, ping_timeout, + t, g_direct_equal, NULL); /* act like we just timed out immediately, to start the pinging process now instead of after the first delay. this makes sure the client ends up in the ping_ids hash table now. */

@@ -132,9 +132,9 @@ g_hash_table_insert(ping_ids, &t->id, t);

} /*ob_debug("+PING: '%s' (id %u)\n", t->client->title, t->id);*/ - PROP_MSG_TO(t->client->window, t->client->window, wm_protocols, - prop_atoms.net_wm_ping, t->id, t->client->window, 0, 0, - NoEventMask); + OBT_PROP_MSG_TO(t->client->window, t->client->window, WM_PROTOCOLS, + OBT_PROP_ATOM(NET_WM_PING), t->id, t->client->window, 0, 0, + NoEventMask); } static gboolean ping_timeout(gpointer data)

@@ -159,7 +159,8 @@

if ((t = g_hash_table_find(ping_ids, find_client, client))) { g_hash_table_remove(ping_ids, &t->id); - ob_main_loop_timeout_remove_data(ob_main_loop, ping_timeout, t, FALSE); + obt_main_loop_timeout_remove_data(ob_main_loop, ping_timeout, + t, FALSE); g_free(t); }
M openbox/resist.hopenbox/resist.h

@@ -19,9 +19,11 @@

#ifndef ob__resist_h #define ob__resist_h -struct _ObClient; +#include "misc.h" #include <glib.h> + +struct _ObClient; /*! @x The client's x destination (in the client's coordinates, not the frame's @y The client's y destination (in the client's coordinates, not the frame's
M openbox/screen.copenbox/screen.c

@@ -24,7 +24,6 @@ #include "grab.h"

#include "startupnotify.h" #include "moveresize.h" #include "config.h" -#include "mainloop.h" #include "screen.h" #include "client.h" #include "session.h"

@@ -36,6 +35,7 @@ #include "render/render.h"

#include "gettext.h" #include "obt/display.h" #include "obt/prop.h" +#include "obt/mainloop.h" #include <X11/Xlib.h> #ifdef HAVE_UNISTD_H

@@ -661,9 +661,9 @@ }

} } screen_desktop_timeout = FALSE; - ob_main_loop_timeout_remove(ob_main_loop, last_desktop_func); - ob_main_loop_timeout_add(ob_main_loop, REMEMBER_LAST_DESKTOP_TIME, - last_desktop_func, NULL, NULL, NULL); + obt_main_loop_timeout_remove(ob_main_loop, last_desktop_func); + obt_main_loop_timeout_add(ob_main_loop, REMEMBER_LAST_DESKTOP_TIME, + last_desktop_func, NULL, NULL, NULL); ob_debug("Moving to desktop %d\n", num+1);

@@ -922,15 +922,15 @@ pager_popup_max_width(desktop_popup,

MAX(a->width/3, POPUP_WIDTH)); pager_popup_show(desktop_popup, screen_desktop_names[d], d); - ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func); - ob_main_loop_timeout_add(ob_main_loop, config_desktop_popup_time * 1000, - hide_desktop_popup_func, NULL, NULL, NULL); + obt_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func); + obt_main_loop_timeout_add(ob_main_loop, config_desktop_popup_time * 1000, + hide_desktop_popup_func, NULL, NULL, NULL); g_free(a); } void screen_hide_desktop_popup(void) { - ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func); + obt_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func); pager_popup_hide(desktop_popup); }
M openbox/stacking.copenbox/stacking.c

@@ -129,7 +129,7 @@ break;

} win[1] = window_top(window); - XRestackWindows(ob_display, win, 2); + XRestackWindows(obt_display, win, 2); pause_changes = TRUE; }

@@ -144,7 +144,7 @@ win = g_new(Window, g_list_length(stacking_list) + 1);

win[0] = screen_support_win; for (i = 1, it = stacking_list; it; ++i, it = g_list_next(it)) win[i] = window_top(it->data); - XRestackWindows(ob_display, win, i); + XRestackWindows(obt_display, win, i); g_free(win); pause_changes = FALSE;