[maemo-developers] Moving windows in Maemo
From: Sean Luke sean at cs.gmu.eduDate: Sun Apr 8 18:20:45 EEST 2007
- Previous message: x11vnc no response to taps on left of screen
- Next message: Moving windows in Maemo
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm wondering if anyone has had previous experience in moving windows in maemo. I'm experimenting with various things which involve small movable or resizable windows. Yeah, yeah, I know that Nokia's UI guidelines foolishly declare that you can't move any windows, and that all drag-and-drop must stop at the app windows' edge. 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. There are three possibilities: - I'm doing window moves all wrong. The most likely case: in which case, how do I do it right? - This bug was never caught by Nokia because it's a use case they didn't expect due to their UI guidelines. - [conspiracy theorist alert :-)] Nokia specified the UI guidelines the way they did in order to avoid fixing this bug. :-) I strongly suspect the first. Anyone tried to do this before? No doubt I'm screwing something up. I'm running on an N800, not upgraded yet. Sean 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. 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 BUTTON_PRESSED, # no BUTTON_PRESSED event actually gets through -- instead, MOTION_NOTIFY # 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'm using begin_move_drag here, but if I implement it myself with move(...), # the same exact buggy artifacts occur. b.connect("button_press_event", lambda widget, event: g.window.begin_move_drag(event.button, event.x + g.window.get_root_origin()[0], event.y + g.window.get_root_origin()[1], event.time)) g.show_all() gtk.main()
- Previous message: x11vnc no response to taps on left of screen
- Next message: Moving windows in Maemo
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]