[FreeNX-kNX] bad timestamp in _NET_WM_USER_TIME

Amir Vadai amirva at gmail.com
Thu Sep 15 12:47:21 UTC 2011


On Thu, Sep 15, 2011 at 3:04 PM, <chris at ccburton.com> wrote:

>
> freenx-knx-bounces at kde.org wrote on 14/09/2011 13:43:32:
>
> [SNIP]
>
> > When clicking on the window, it does get the focus - only alt-tab
> > doesn't work.
> > Alt-tab is working between 2 local windows. When current window or
> > previous window is nx window - the focus doesn't change and it stays
> > where it was before the alt-tab.
> >
> > And when I looked at the debug prints, I saw the user_time property
> > of the nx windows is completely in another range comparing to local
> windows.
>
> I don't think keynav focus uses _NET_WM_USER_TIME
>
> Try it with a full NX desktop on mutter and see if you
> can Alt-Tab OK . . .
>
Alt-tab calls  activate_window (in  /usr/share/gnome-shell/js/ui/altTab.js).
this calls  shell_app_activate_window() (from  gnome-shell/src/shell-app.c)
and there they check the user_time before switching to window:

void
shell_app_activate_window (ShellApp     *app,
                           MetaWindow   *window,
                           guint32       timestamp)
{
  GSList *windows;

  if (shell_app_get_state (app) != SHELL_APP_STATE_RUNNING)
    return;

  windows = shell_app_get_windows (app);
  if (window == NULL && windows)
    window = windows->data;

  if (!g_slist_find (windows, window))
    return;
  else
    {
      GSList *iter;
      ShellGlobal *global = shell_global_get ();
      MetaScreen *screen = shell_global_get_screen (global);
      MetaDisplay *display = meta_screen_get_display (screen);
      MetaWorkspace *active = meta_screen_get_active_workspace (screen);
      MetaWorkspace *workspace = meta_window_get_workspace (window);
*      guint32 last_user_timestamp = meta_display_get_last_user_time
(display);*
      MetaWindow *most_recent_transient;

*      if (meta_display_xserver_time_is_before (display, timestamp,
last_user_timestamp))*
        {
          meta_window_set_demands_attention (window);
          return;
        }

      /* Now raise all the other windows for the app that are on
       * the same workspace, in reverse order to preserve the stacking.
       */
      for (iter = windows; iter; iter = iter->next)
        {
          MetaWindow *other_window = iter->data;

          if (other_window != window)
            meta_window_raise (other_window);
        }

      /* If we have a transient that the user's interacted with more
recently than
       * the window, pick that.
       */
      most_recent_transient = find_most_recent_transient_on_same_workspace
(display, window);
      if (most_recent_transient
          && meta_display_xserver_time_is_before (display,
                                                  meta_window_get_user_time
(window),
                                                  meta_window_get_user_time
(most_recent_transient)))
        window = most_recent_transient;


      if (!shell_window_tracker_is_window_interesting (window))
        {
          /* We won't get notify::user-time signals for uninteresting
windows,
           * which means that an app's last_user_time won't get updated.
           * Update it here instead.
           */
          app->running_state->last_user_time = timestamp;
        }

      if (active != workspace)
        meta_workspace_activate_with_focus (workspace, window, timestamp);
      else
*        meta_window_activate (window, timestamp);*
    }
}



and as you can see they do refer to the user_time there in many places.

- Amir



>
> > - Amir
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20110915/8b2a8a29/attachment.html>


More information about the FreeNX-kNX mailing list