Skip to content

Commit

Permalink
Another shot at focus stuff (as feature requested)
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Oct 23, 2008
1 parent fe02672 commit 54a1cd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion efl_launcher/src/ruby/Edjewin.rb
Expand Up @@ -32,4 +32,3 @@ def show
attr_accessor :ee, :edje
end


11 changes: 8 additions & 3 deletions xlib_ruby/x11_wrap.c
Expand Up @@ -107,14 +107,19 @@ static VALUE wm_num_clients(VALUE self) {

static VALUE wm_selected(VALUE self) {
WM *newwm;
Window focus_return;
XEvent event_return, event_saviour;
int i;

Data_Get_Struct(self, WM, newwm);

XGetInputFocus(newwm->dpy, &focus_return, &i);
// Cycle through focus events and get the most recent
XCheckTypedEvent(newwm->dpy, FocusIn, &event_return);
/*
while (XCheckTypedEvent(newwm->dpy, FocusIn, &event_return))
*/
event_saviour = event_return;
for (i=0; i<newwm->clients_num; i++)
if (&newwm->clients[i].win == &focus_return)
if (&newwm->clients[i].win == &event_saviour.xany.window)
newwm->selected = &newwm->clients[i];
return client_make(cClient, newwm->selected);
}
Expand Down

0 comments on commit 54a1cd0

Please sign in to comment.