[maemo-developers] Moving windows in Maemo

From: Kalle Vahlman kalle.vahlman at gmail.com
Date: Mon Apr 9 11:38:24 EEST 2007
2007/4/8, Sean Luke <sean at cs.gmu.edu>:
> Anyway, I whipped up the following little program below as a test and
> low and behold I can get the window to drag around BUT it creates all
> sorts of artifacts: screen tearing, a bizarre window flashing in the
> top-left corner, and slow updates.  The window moves very slowly
> too.  Not what I would have expected for a 300MHz machine.

Attached is a revised version of the test app, that doesn't show the
bug at least (changes commented below).

Few notes on dragging:

 - The tearing is due to the poor screen update rate (basically a hw limitation)
 - I'm under the impression that there is some (heavy?) filtering
going on wrt touchscreen input (to check the pressure data and so on),
and also physical limits of the touchscreen I guess (it's really easy
to make it think you lifted the stylys for example). Both of these
have an impact on how well the dragging will work.

> import gtk
> # We create a Dialog because maemo has hard-locked gtk.Window to be
> the full
> # size of the screen, and I've found now way to counteract that.

g = gtk.Window(gtk.WINDOW_POPUP)

works fine.

>  We
> then
> # delete the separator and make the window bright blue.
> g = gtk.Dialog()
> g.set_has_separator(False)
> g.set_decorated(False)
> g.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,65535))
> g.resize(100,100)
> g.move(300,300)
> # We add a button to the Dialog and try to move after the Button has
> # been pushed because if you set Dialog's mask to include
> # no BUTTON_PRESSED event actually gets through -- instead,
> # starts coming in incorrectly.  Looks like another bug.  So we have to
> # use a Button to grab the BUTTON_PRESSED events...
> b = gtk.Button()
> g.vbox.add(b)

I don't know what you tried here with the event mask, but


works just fine here (maybe it's the dialog that didn't work with this?)

Kalle Vahlman, zuh at iki.fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 1021 bytes
Desc: not available
Url : http://lists.maemo.org/pipermail/maemo-developers/attachments/20070409/58daa71b/attachment.py 
More information about the maemo-developers mailing list