| The Following User Says Thank You to brad112358 For This Useful Post: | ||
|
|
2010-01-06
, 05:42
|
|
|
Posts: 188 |
Thanked: 185 times |
Joined on Dec 2009
@ Finland
|
#2
|
|
|
2010-01-06
, 07:39
|
|
|
Posts: 4,274 |
Thanked: 5,358 times |
Joined on Sep 2007
@ Looking at y'all and sighing
|
#3
|
| The Following User Says Thank You to qwerty12 For This Useful Post: | ||
|
|
2010-01-09
, 20:06
|
|
Posts: 37 |
Thanked: 54 times |
Joined on Dec 2009
|
#4
|
| The Following 3 Users Say Thank You to brad112358 For This Useful Post: | ||
|
|
2010-01-26
, 14:21
|
|
|
Posts: 122 |
Thanked: 135 times |
Joined on Dec 2009
@ Helsinki
|
#5
|
#include <X11/Xlib.h>
#include <X11/Xatom.h>
/* Rotate window into portrat mode and make fullscreen */
void portraitmode(Window win)
{
unsigned char on = 1;
Display * dpy = XOpenDisplay(0/*null*/);/* or use toolkit's dpy variable */
Atom newstate;
XChangeProperty(dpy, win,
XInternAtom(dpy, "_HILDON_PORTRAIT_MODE_SUPPORT", True),
XA_CARDINAL, 32, PropModeReplace, &on, 1);
XChangeProperty(dpy, win,
XInternAtom(dpy, "_HILDON_PORTRAIT_MODE_REQUEST", True),
XA_CARDINAL, 32, PropModeReplace, &on, 1);
newstate = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", True);
XChangeProperty(dpy, win,
XInternAtom(dpy, "_NET_WM_STATE", True), XA_ATOM, 32,
PropModeReplace, (unsigned char *) &newstate, 1);
}
#include <gdk/gdkx.h> ... GtkWidget * mainwin = hildon_stackable_window_new(); ... gtk_widget_show_all (mainwin); portraitmode(GDK_WINDOW_XID(mainwin->window)); gtk_main();
| The Following 3 Users Say Thank You to too For This Useful Post: | ||
|
|
2010-01-26
, 14:29
|
|
|
Posts: 4,274 |
Thanked: 5,358 times |
Joined on Sep 2007
@ Looking at y'all and sighing
|
#6
|
Thanks
complete function which does this:
and, parts from gtk programCode:#include <X11/Xlib.h> #include <X11/Xatom.h> /* Rotate window into portrat mode and make fullscreen */ void portraitmode(Window win) { unsigned char on = 1; Display * dpy = XOpenDisplay(0/*null*/);/* or use toolkit's dpy variable */ Atom newstate; XChangeProperty(dpy, win, XInternAtom(dpy, "_HILDON_PORTRAIT_MODE_SUPPORT", True), XA_CARDINAL, 32, PropModeReplace, &on, 1); XChangeProperty(dpy, win, XInternAtom(dpy, "_HILDON_PORTRAIT_MODE_REQUEST", True), XA_CARDINAL, 32, PropModeReplace, &on, 1); newstate = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", True); XChangeProperty(dpy, win, XInternAtom(dpy, "_NET_WM_STATE", True), XA_ATOM, 32, PropModeReplace, (unsigned char *) &newstate, 1); }
Code:#include <gdk/gdkx.h> ... GtkWidget * mainwin = hildon_stackable_window_new(); ... gtk_widget_show_all (mainwin); portraitmode(GDK_WINDOW_XID(mainwin->window)); gtk_main();
| The Following 3 Users Say Thank You to qwerty12 For This Useful Post: | ||
|
|
2010-01-27
, 07:51
|
|
|
Posts: 122 |
Thanked: 135 times |
Joined on Dec 2009
@ Helsinki
|
#7
|
If this is for a GTK+ application, why not just use hildon_gtk_window_set_portrait_flags()?
http://wiki.maemo.org/Using_Fremantl...creen_Rotation explains it quite well.

hildon_gtk_window_set_portrait_flags(GTK_WINDOW (mainwin), HILDON_PORTRAIT_MODE_REQUEST);

| The Following User Says Thank You to too For This Useful Post: | ||
Does hildon_gtk_window_set_portrait_flags ultimately use the X RandR extension, or is it doing something else? I guess I can link in libhildon, and enough of libgtk and friends to make it happy, but will I also have to rotate my objects and bitmaps? Or will I then be presented with a 480x800 display rather than the normal 800x480 display (which would be the case if it uses the RandR to rotate the screen)?
I found some statements implying that application screen rotation might be handled via the X RandR extension on the N900, but nothing that looked authoritative.
I'd just look at the source, but, it seems that source isn't available for libhildon? (Why???!!!)
Thanks for any clues.
--Brad