maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   any way to quickly switch between apps? (https://talk.maemo.org/showthread.php?t=59624)

extendedping 2010-08-02 15:11

any way to quickly switch between apps?
 
I know you can do ctrl backspace to see the opened apps. but lets say I have 2 apps, fbreader and xterm. is there any way to quickly toggle between them? I don't want to use multiple desktops because I hear that hurts battery...

eMiL 2010-08-02 15:14

Re: any way to quickly switch between apps?
 
Isn't ctrl + backspace (/touch upper left corner of screen) and choose open app fast enough?

extendedping 2010-08-02 15:15

Re: any way to quickly switch between apps?
 
ha I knew that was coming.

I want faster.

Marcus 2010-08-02 15:17

Re: any way to quickly switch between apps?
 
So basically something like ALT+TAB on the desktop pc?

Matan 2010-08-02 15:17

Re: any way to quickly switch between apps?
 
Using multiple desktops does not hurt battery (I wonder where did you hear that), but it cannot help you, since running programs are not tied to specific desktops.

modified-hildon-desktop (in my repository) adds more options for switching between windows. If you want to hasten the switches, you can edit transitions.ini file to shorten the animations.

Marcus 2010-08-02 15:24

Re: any way to quickly switch between apps?
 
Perhaps it is possible to take a look at SuperSwitcher (http://code.google.com/p/superswitcher/) and find out how it "simulates" alt+tab.

Unfortunately I do not know wether Maemo 5 works the same way.

I found this by a quick look:
Code:

void
ss_screen_activate_next_window (SSScreen *screen, gboolean backwards, guint32 time)
{
  SSWorkspace *workspace;
  SSWindow *window;
  GList *i;
  GList *j;

  SSWindow *first_sensitive_window;
  SSWindow *previous_sensitive_window;
  gboolean should_activate_last_sensitive_window;
  gboolean should_activate_next_sensitive_window;
  gboolean found_active_window;

  gboolean also_warp_pointer_if_necessary;

  first_sensitive_window    = NULL;
  previous_sensitive_window = NULL;
  should_activate_last_sensitive_window = FALSE;
  should_activate_next_sensitive_window = FALSE;
  found_active_window = FALSE;
  also_warp_pointer_if_necessary = TRUE;

  for (i = screen->workspaces; i; i = i->next) {
    workspace = (SSWorkspace *) i->data;
    if ((screen->active_window == NULL) && (screen->active_workspace == workspace)) {
      if (backwards) {
        if (previous_sensitive_window == NULL) {
          should_activate_last_sensitive_window = TRUE;
        } else {
          ss_window_activate_workspace_and_window (previous_sensitive_window, time,
            also_warp_pointer_if_necessary);
          return;
        }
      } else {
        should_activate_next_sensitive_window = TRUE;
      }
    }
    for (j = workspace->windows; j; j = j->next) {
      window = (SSWindow *) j->data;

      if (screen->active_window != NULL) {
        found_active_window = (window == screen->active_window);
      }

      if (backwards && found_active_window) {
        if (previous_sensitive_window == NULL) {
          should_activate_last_sensitive_window = TRUE;
        } else {
          ss_window_activate_workspace_and_window (previous_sensitive_window, time,
            also_warp_pointer_if_necessary);
          return;
        }
      }

      if (window->sensitive) {
        if (should_activate_next_sensitive_window) {
          ss_window_activate_workspace_and_window (window, time,
            also_warp_pointer_if_necessary);
          return;
        }

        previous_sensitive_window = window;

        if (first_sensitive_window == NULL) {
          first_sensitive_window = window;
        }
      }

      if (!backwards && found_active_window) {
        should_activate_next_sensitive_window = TRUE;
      }
    }
  }

  if (should_activate_next_sensitive_window) {
    ss_window_activate_workspace_and_window (first_sensitive_window, time,
      also_warp_pointer_if_necessary);
    return;
  }

  if (should_activate_last_sensitive_window) {
    ss_window_activate_workspace_and_window (previous_sensitive_window, time,
      also_warp_pointer_if_necessary);
    return;
  }
}

//------------------------------------------------------------------------------

void
ss_screen_activate_next_window_in_stacking_order (SSScreen *screen, gboolean backwards, guint32 time)
{
  WnckWindow *active_wnck_window;
  WnckWindow *wnck_window;
  gboolean ww_is_aww;
  int active_workspace_id;
  int workspace_id;
  GList *i;
  int num_windows;

  WnckWindow *first_eligible_wnck_window;
  WnckWindow *previous_eligible_wnck_window;
  gboolean should_activate_last_eligible_wnck_window;
  gboolean should_activate_next_eligible_wnck_window;
 
  gboolean also_warp_pointer_if_necessary;
  also_warp_pointer_if_necessary = TRUE;

  num_windows = g_list_length (screen->active_workspace->windows);
  if (num_windows == 0) {
    return;
  }

  // TODO - this is probably an ugly hack that's exposed to a potential
  // race condition.  A better way to go about this would be to suppress
  // the window_stacking_change signal, I suppose.
  // For example, if a window gets opened in between setting this flag
  // and in the event handler on_window_stacking_changed, then the
  // window_stacking_order list will be copied at the wrong point,
  // possibly.
  screen->should_ignore_next_window_stacking_change = TRUE;

  first_eligible_wnck_window    = NULL;
  previous_eligible_wnck_window = NULL;
  should_activate_last_eligible_wnck_window = FALSE;
  should_activate_next_eligible_wnck_window = FALSE;

  if (screen->active_window != NULL) {
    active_wnck_window = screen->active_window->wnck_window;
  } else {
    active_wnck_window = NULL;
  }
  active_workspace_id = wnck_workspace_get_number (wnck_screen_get_active_workspace (screen->wnck_screen));

  // Note that wnck_windows_in_stacking_order is in bottom-to-top
  // order, so that if we're searching forwards (just like Alt-Tab)
  // then we want the previous_eligible_wnck_window.  This is the
  // opposite ordering than in ss_screen_activate_next_window.
  for (i = screen->wnck_windows_in_stacking_order; i; i = i->next) {
    wnck_window = (WnckWindow *) i->data;
    workspace_id = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window));

    if (workspace_id != active_workspace_id) {
      continue;
    }

    if (active_wnck_window != NULL) {
      ww_is_aww = (wnck_window_get_xid (wnck_window) ==
        wnck_window_get_xid (active_wnck_window));
    } else {
      ww_is_aww = FALSE;
    }

    // We've found the active window, and we're searching forwards.
    if (!backwards && ww_is_aww) {
      if (previous_eligible_wnck_window == NULL) {
        should_activate_last_eligible_wnck_window = TRUE;
      } else {
        ss_window_activate_window (get_ss_window_from_wnck_window (
          screen, previous_eligible_wnck_window), time,
          also_warp_pointer_if_necessary);
        return;
      }
    }

    if (should_activate_next_eligible_wnck_window) {
      ss_window_activate_window (get_ss_window_from_wnck_window (
        screen, wnck_window), time, also_warp_pointer_if_necessary);
      return;
    }

    previous_eligible_wnck_window = wnck_window;

    if (first_eligible_wnck_window == NULL) {
      first_eligible_wnck_window = wnck_window;
    }

    // We've found the active window, and we're searching backwards.
    if (backwards && ww_is_aww) {
      should_activate_next_eligible_wnck_window = TRUE;
    }
  }

  if (active_wnck_window == NULL) {
    if (backwards) {
      should_activate_next_eligible_wnck_window = TRUE;
    } else {
      should_activate_last_eligible_wnck_window = TRUE;
    }
  }

  if (should_activate_next_eligible_wnck_window) {
    ss_window_activate_window (get_ss_window_from_wnck_window (
      screen, first_eligible_wnck_window), time, also_warp_pointer_if_necessary);
    return;
  }

  if (should_activate_last_eligible_wnck_window) {
    ss_window_activate_window (get_ss_window_from_wnck_window (
      screen, previous_eligible_wnck_window), time, also_warp_pointer_if_necessary);
    return;
  }
}


xuggs 2010-08-02 15:32

Re: any way to quickly switch between apps?
 
Oh yes something like an alt+tab would be great.

festivalnut 2010-08-02 15:33

Re: any way to quickly switch between apps?
 
before i updated to pr1.2 i could switch my two most recent windows with ctrl+space, doesn't work now though.

Matan 2010-08-02 15:37

Re: any way to quickly switch between apps?
 
Quote:

Originally Posted by festivalnut (Post 773185)
before i updated to pr1.2 i could switch my two most recent windows with ctrl+space, doesn't work now though.

You probably had modified-hildon-desktop installed, but did not reinstall it after upgrading to PR1.2.

TNiga 2010-08-02 15:37

Re: any way to quickly switch between apps?
 
Matan's modified-hildon-desktop allows alt+tab like behaviour using ctrl+backspace, so just install it.

festivalnut 2010-08-02 15:39

Re: any way to quickly switch between apps?
 
Quote:

Originally Posted by Matan (Post 773189)
You probably had modified-hildon-desktop installed, but did not reinstall it after upgrading to PR1.2.

unless it came bundled as part of another app i dont think so, plus i upgraded OTA so my apps were left intact, and i'd remember any script type xterm fiddling to achieve this function if thats how its installed... maybe i just had a weird n900! :)

extendedping 2010-08-02 15:43

Re: any way to quickly switch between apps?
 
Quote:

Originally Posted by TNiga (Post 773190)
Matan's modified-hildon-desktop allows alt+tab like behaviour using ctrl+backspace, so just install it.

installed it and locked my desktop. next learn to better switch apps.

mhdkv 2010-08-02 15:44

Re: any way to quickly switch between apps?
 
Tried Shortcutd ?

Marcus 2010-08-02 15:54

Re: any way to quickly switch between apps?
 
Once again, I do not know wether this is possible.

Port GConf-Editor to Maemo5 (It is on OS2005 atm), and simply do the steps to create custom shortcuts. (http://www.cyberciti.biz/faq/howto-c...cuts-in-gnome/)

VulcanRidr 2010-08-02 17:24

Re: any way to quickly switch between apps?
 
Quote:

Originally Posted by extendedping (Post 773143)
I know you can do ctrl backspace to see the opened apps. but lets say I have 2 apps, fbreader and xterm. is there any way to quickly toggle between them? I don't want to use multiple desktops because I hear that hurts battery...

I just found camkeyd. It allows you to use a half-press on the camera button to get you to the running apps screen.

--vr

Bratag 2010-08-02 17:33

Re: any way to quickly switch between apps?
 
I use shortcutd. Prox sensor can be mapped to take you to switcher.


All times are GMT. The time now is 21:00.

vBulletin® Version 3.8.8