Editing Using Fremantle widgets

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 433: Line 433:
Do you want it even more comfortable? See [http://talk.maemo.org/showthread.php?p=330992 this forum post] for a link to an easy-to-use drop-in module that will take care of auto-rotation all your application windows.
Do you want it even more comfortable? See [http://talk.maemo.org/showthread.php?p=330992 this forum post] for a link to an easy-to-use drop-in module that will take care of auto-rotation all your application windows.
-
 
-
=== Forcing screen rotation ===
 
-
 
-
If you need a way to force some rotation of your N900 screen, this is for you.
 
-
 
-
<source lang="c">
 
-
/*
 
-
gcc rotate.c -lX11 -lXrandr
 
-
*/
 
-
#include <X11/Xlib.h>
 
-
#include <X11/extensions/Xrandr.h>
 
-
 
-
static void set_rotation (Rotation r_to) {
 
-
  Rotation r;
 
-
  int screen = -1;
 
-
  XRRScreenConfiguration* config;
 
-
  int current_size=0;
 
-
 
-
  Display* display;
 
-
  Window rootWindow;
 
-
 
 
-
      display = XOpenDisplay(":0");
 
-
      if (display == NULL) {
 
-
        return;
 
-
      }
 
-
 
-
      screen = DefaultScreen(display);
 
-
      rootWindow = RootWindow(display, screen);
 
-
      XRRRotations(display, screen, &r);
 
-
      config = XRRGetScreenInfo(display, rootWindow);
 
-
      current_size = XRRConfigCurrentConfiguration (config, &r);
 
-
      XRRSetScreenConfig(display, config, rootWindow, current_size, r_to, CurrentTime);
 
-
}
 
-
 
-
int main (int argc, char *argv[]) {
 
-
set_rotation(RR_Rotate_90);
 
-
//set_rotation(RR_Rotate_270);
 
-
//set_rotation(RR_Rotate_180);
 
-
//set_rotation(RR_Rotate_0);
 
-
}
 
-
</source>
 
=== Testing Hardware Orientation In Scratchbox ===
=== Testing Hardware Orientation In Scratchbox ===

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)