From 03f0135c3a4e45198e3040ac4773a6aac7d11acb Mon Sep 17 00:00:00 2001 From: Benoit Gschwind Date: Sat, 23 Feb 2008 14:42:56 +0100 Subject: [PATCH] move_in_progress is back in openbox-core --- engines/default/plugin.c | 1 - openbox/client.c | 2 +- openbox/engine_interface.c | 2 +- openbox/engine_interface.h | 2 +- openbox/event.c | 8 ++++---- openbox/moveresize.c | 12 ++++++------ openbox/moveresize.h | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/engines/default/plugin.c b/engines/default/plugin.c index 27d00044..0c21c307 100644 --- a/engines/default/plugin.c +++ b/engines/default/plugin.c @@ -1582,7 +1582,6 @@ ObFrameEngine engine = { load_theme_config, /* */ /* This fields are fill by openbox. */ 0, /*struct _ObClient *focus_cycle_target; */ - FALSE, /*gboolean moveresize_in_progress;*/ }; ObFrameEngine * get_info() diff --git a/openbox/client.c b/openbox/client.c index 15c430d7..da38ea6b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -474,7 +474,7 @@ void client_manage(Window window, ObPrompt *prompt) self->w_client, map_time, launch_time, event_last_user_time); - if (menu_frame_visible || frame_engine.moveresize_in_progress) { + if (menu_frame_visible || moveresize_in_progress) { activate = FALSE; raise = TRUE; ob_debug_type(OB_DEBUG_FOCUS, diff --git a/openbox/engine_interface.c b/openbox/engine_interface.c index 7c1c9e9e..83641d47 100644 --- a/openbox/engine_interface.c +++ b/openbox/engine_interface.c @@ -225,7 +225,7 @@ ObFrameContext frame_context_from_string(const gchar *name) ObFrameContext engine_frame_context(ObClient *client, Window win, gint x, gint y) { /* this part is commun to all engine */ - if (frame_engine.moveresize_in_progress) + if (moveresize_in_progress) return OB_FRAME_CONTEXT_MOVE_RESIZE; if (win == obt_root(ob_screen)) return OB_FRAME_CONTEXT_ROOT; diff --git a/openbox/engine_interface.h b/openbox/engine_interface.h index 7be7eae5..1f1e62ea 100644 --- a/openbox/engine_interface.h +++ b/openbox/engine_interface.h @@ -186,7 +186,7 @@ struct _ObFrameEngine /* Filled by openbox-core */ struct _ObClient *focus_cycle_target; - gboolean moveresize_in_progress; + //gboolean moveresize_in_progress; }; /* Define how to draw the current windows */ enum _ObStyle diff --git a/openbox/event.c b/openbox/event.c index acbf671c..074708da 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -727,7 +727,7 @@ static void event_process(const XEvent *ec, gpointer data) e->type == obt_display_extension_sync_basep + XSyncAlarmNotify) { XSyncAlarmNotifyEvent *se = (XSyncAlarmNotifyEvent*)e; - if (se->alarm == moveresize_alarm && frame_engine.moveresize_in_progress) + if (se->alarm == moveresize_alarm && moveresize_in_progress) moveresize_event(e); } #endif @@ -1879,7 +1879,7 @@ static void event_handle_user_input(ObClient *client, XEvent *e) /* if the keyboard interactive action uses the event then dont use it for bindings. likewise is moveresize uses the event. */ if (!actions_interactive_input_event(e) && !moveresize_event(e)) { - if (frame_engine.moveresize_in_progress) + if (moveresize_in_progress) /* make further actions work on the client being moved/resized */ client = moveresize_client; @@ -1914,7 +1914,7 @@ static gboolean focus_delay_func(gpointer data) Time old = event_curtime; /* don't move focus and kill the menu or the move/resize */ - if (menu_frame_visible || frame_engine.moveresize_in_progress) return FALSE; + if (menu_frame_visible || moveresize_in_progress) return FALSE; event_curtime = d->time; event_curserial = d->serial; @@ -2002,7 +2002,7 @@ void event_cancel_all_key_grabs(void) menu_frame_hide_all(); ob_debug("KILLED open menus"); } - else if (frame_engine.moveresize_in_progress) { + else if (moveresize_in_progress) { moveresize_end(TRUE); ob_debug("KILLED interactive moveresize"); } diff --git a/openbox/moveresize.c b/openbox/moveresize.c index fbf865ae..9ffe0c6e 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -40,7 +40,7 @@ /* how far windows move and resize with the keyboard arrows */ #define KEY_DIST 8 -//gboolean moveresize_in_progress = FALSE; +gboolean moveresize_in_progress = FALSE; ObClient *moveresize_client = NULL; #ifdef SYNC XSyncAlarm moveresize_alarm = None; @@ -85,7 +85,7 @@ void moveresize_startup(gboolean reconfig) void moveresize_shutdown(gboolean reconfig) { if (!reconfig) { - if (frame_engine.moveresize_in_progress) + if (moveresize_in_progress) moveresize_end(FALSE); client_remove_destroy_notify(client_dest); } @@ -175,7 +175,7 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) gint up = 1; gint left = 1; - if (frame_engine.moveresize_in_progress || !frame_engine.frame_is_visible(c->frame) || + if (moveresize_in_progress || !frame_engine.frame_is_visible(c->frame) || !(mv ? (c->functions & OB_CLIENT_FUNC_MOVE) : (c->functions & OB_CLIENT_FUNC_RESIZE))) @@ -253,7 +253,7 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) cur_w = start_cw; cur_h = start_ch; - frame_engine.moveresize_in_progress = TRUE; + moveresize_in_progress = TRUE; #ifdef SYNC if (config_resize_redraw && !moving && obt_display_extension_sync && @@ -331,7 +331,7 @@ void moveresize_end(gboolean cancel) /* dont edge warp after its ended */ cancel_edge_warp(); - frame_engine.moveresize_in_progress = FALSE; + moveresize_in_progress = FALSE; moveresize_client = NULL; } @@ -835,7 +835,7 @@ gboolean moveresize_event(XEvent *e) { gboolean used = FALSE; - if (!frame_engine.moveresize_in_progress) return FALSE; + if (!moveresize_in_progress) return FALSE; if (e->type == ButtonPress) { if (!button) { diff --git a/openbox/moveresize.h b/openbox/moveresize.h index ad222558..2d0f7dce 100644 --- a/openbox/moveresize.h +++ b/openbox/moveresize.h @@ -33,7 +33,7 @@ typedef enum { OB_RESIZE_POS_FIXED } ObResizePopupPos; -//extern gboolean moveresize_in_progress; +extern gboolean moveresize_in_progress; extern struct _ObClient *moveresize_client; #ifdef SYNC extern XSyncAlarm moveresize_alarm; -- 2.34.1