diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2015-08-14 10:24:35 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2015-08-14 10:24:35 +0100 |
commit | 1edfdff093cd7aec3185134c5718264847abddab (patch) | |
tree | cccf78d92528b6c442fc8d0c9eb158502b6a4545 | |
parent | fb5eda6882bd598bd15f2617b7aadbf302056ba4 (diff) |
Start using xdolib to replay
Currently only used for moving window
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | play.cpp | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 221609c..3433d29 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ bin_PROGRAMS = spice-replay AM_CFLAGS = $(CWARNFLAGS) $(REPLAY_CFLAGS) -spice_replay_LDADD = $(REPLAY_LIBS) +spice_replay_LDADD = $(REPLAY_LIBS) -lxdo spice_replay_LINK = $(LINK) spice_replay_SOURCES = \ @@ -9,6 +9,13 @@ #ifdef HAVE_XI2 #include <X11/extensions/XInput2.h> #endif +#include <X11/XKBlib.h> + +#define class _class +extern "C" { +#include <xdo.h> +}; +#undef class #include "global.h" #include "rec.h" @@ -39,6 +46,8 @@ void play(const char *fn, Window win) exit(EXIT_FAILURE); } + xdo_t *xdo = xdo_new_with_opened_display(dpy, NULL, False); + Rect rc = get_win_pos(win); ReadRecordsFile file(fn); @@ -116,11 +125,16 @@ void play(const char *fn, Window win) case Record::TargetWindow: target_win = rec.get_field(Record::Window); break; + case Record::WindowMove: + xdo_window_move(xdo, win, rec.get_field(Record::X), rec.get_field(Record::Y)); break; default: fprintf (stderr, "unknown type %u\n", rec.get_type()); exit(EXIT_FAILURE); } + XFlush(dpy); } + + xdo_free(xdo); } |