#include "grab.h"
#include "menu.h"
#include "prompt.h"
+#include "edges.h"
#include "menuframe.h"
#include "keyboard.h"
#include "mouse.h"
static guint unfocus_delay_timeout_id = 0;
static ObClient *unfocus_delay_timeout_client = NULL;
+extern guint button;
+
#ifdef USE_SM
static gboolean ice_handler(GIOChannel *source, GIOCondition cond,
gpointer conn)
case OB_WINDOW_CLASS_MENUFRAME:
menu = WINDOW_AS_MENUFRAME(obwin);
break;
- case OB_WINDOW_CLASS_INTERNAL:
- /* we don't do anything with events directly on these windows */
- break;
case OB_WINDOW_CLASS_PROMPT:
prompt = WINDOW_AS_PROMPT(obwin);
break;
/* ...or it if it was physically on an openbox
internal window... */
((w = window_find(e->xbutton.subwindow)) &&
- (WINDOW_IS_INTERNAL(w) || WINDOW_IS_DOCK(w))))
+ (WINDOW_IS_INTERNAL(w) || WINDOW_IS_DOCK(w) || WINDOW_IS_EDGE(w))))
/* ...then process the event, otherwise ignore it */
{
used = event_handle_user_input(client, e);
if (e->type == ButtonPress)
pressed = e->xbutton.button;
+ /* We ignored the release event so make sure we don't think
+ the button is still pressed */
+ else if (e->type == ButtonRelease)
+ button = 0;
}
}
else if (e->type == KeyPress || e->type == KeyRelease ||
}
case ConfigureRequest:
{
+ if (client->locked)
+ break;
+
/* dont compress these unless you're going to watch for property
notifies in between (these can change what the configure would
do to the window).
msgtype = e->xclient.message_type;
if (msgtype == OBT_PROP_ATOM(WM_CHANGE_STATE)) {
if (!more_client_message_event(client->window, msgtype))
- client_set_wm_state(client, e->xclient.data.l[0]);
+ if (!client->locked)
+ client_set_wm_state(client, e->xclient.data.l[0]);
} else if (msgtype == OBT_PROP_ATOM(NET_WM_DESKTOP)) {
if (!more_client_message_event(client->window, msgtype) &&
((unsigned)e->xclient.data.l[0] < screen_num_desktops ||
e->xclient.data.l[1], e->xclient.data.l[2],
client->window);
- /* ignore enter events caused by these like ob actions do */
- if (!config_focus_under_mouse)
- ignore_start = event_start_ignore_all_enters();
- client_set_state(client, e->xclient.data.l[0],
- e->xclient.data.l[1], e->xclient.data.l[2]);
- if (!config_focus_under_mouse)
- event_end_ignore_all_enters(ignore_start);
+ if (!client->locked) {
+ /* ignore enter events caused by these like ob actions do */
+ if (!config_focus_under_mouse)
+ ignore_start = event_start_ignore_all_enters();
+ client_set_state(client, e->xclient.data.l[0],
+ e->xclient.data.l[1], e->xclient.data.l[2]);
+ if (!config_focus_under_mouse)
+ event_end_ignore_all_enters(ignore_start);
+ }
} else if (msgtype == OBT_PROP_ATOM(NET_CLOSE_WINDOW)) {
ob_debug("net_close_window for 0x%lx", client->window);
- client_close(client);
+ if (!client->locked)
+ client_close(client);
} else if (msgtype == OBT_PROP_ATOM(NET_ACTIVE_WINDOW)) {
ob_debug("net_active_window for 0x%lx source=%s",
client->window,
(Atom)e->xclient.data.l[2] ==
OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE_KEYBOARD))
{
- moveresize_start(client, e->xclient.data.l[0],
- e->xclient.data.l[1], e->xclient.data.l[3],
- e->xclient.data.l[2]);
+ if (!client->locked)
+ moveresize_start(client, e->xclient.data.l[0],
+ e->xclient.data.l[1], e->xclient.data.l[3],
+ e->xclient.data.l[2]);
}
else if ((Atom)e->xclient.data.l[2] ==
OBT_PROP_ATOM(NET_WM_MOVERESIZE_CANCEL))
if (moveresize_client)
moveresize_end(TRUE);
} else if (msgtype == OBT_PROP_ATOM(NET_MOVERESIZE_WINDOW)) {
+ if (client->locked)
+ break;
+
gint ograv, x, y, w, h;
ograv = client->gravity;