Changeset 246:bf4298ec3d46 for src/mlx


Ignore:
Timestamp:
06/12/12 18:14:19 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Fixed the problem with the main window not being responsive to keystrokes after showing after being hidden by minimization

Location:
src/mlx/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/common.py

    r241 r246  
    5959
    6060    WEIGHT_BOLD = pango.WEIGHT_BOLD
     61
     62    WINDOW_STATE_ICONIFIED = gdk.WINDOW_STATE_ICONIFIED
     63    WINDOW_STATE_WITHDRAWN = gdk.WINDOW_STATE_WITHDRAWN
    6164
    6265    pixbuf_new_from_file = gdk.pixbuf_new_from_file
     
    112115    WEIGHT_BOLD = pango.Weight.BOLD
    113116
     117    WINDOW_STATE_ICONIFIED = gdk.WindowState.ICONIFIED
     118    WINDOW_STATE_WITHDRAWN = gdk.WindowState.WITHDRAWN
     119
    114120    pixbuf_new_from_file = gdkPixbuf.Pixbuf.new_from_file
    115121
  • src/mlx/gui/gui.py

    r241 r246  
    544544        iconified = gdk.WindowState.ICONIFIED if pygobject \
    545545                    else gdk.WINDOW_STATE_ICONIFIED
    546         if self.config.hideMinimizedWindow and \
    547            (event.changed_mask&iconified)!=0 and \
    548            (event.new_window_state&iconified)!=0:
     546
     547        if (event.changed_mask&WINDOW_STATE_WITHDRAWN)!=0:
     548            if (event.new_window_state&WINDOW_STATE_WITHDRAWN)!=0:
     549                self._statusIcon.mainWindowHidden()
     550            else:
     551                self._statusIcon.mainWindowShown()
     552
     553        if self.config.hideMinimizedWindow and not pygobject and \
     554           (event.changed_mask&WINDOW_STATE_ICONIFIED)!=0 and \
     555           (event.new_window_state&WINDOW_STATE_ICONIFIED)!=0:
    549556            self.hideMainWindow(savePosition = False)
    550 
     557        elif (event.changed_mask&WINDOW_STATE_ICONIFIED)!=0 and \
     558             (event.new_window_state&WINDOW_STATE_ICONIFIED)==0:
     559            self._mainWindow.present()
     560           
    551561    def raiseCallback(self):
    552562        """Callback for the singleton handling code."""
     
    554564
    555565    def raiseMainWindow(self):
    556         """SHow the main window if invisible, and raise it."""
     566        """Show the main window if invisible, and raise it."""
    557567        if not self._mainWindow.get_visible():
    558568            self.showMainWindow()
     
    567577            self._mainWindowX = self._mainWindowY = None
    568578        self._mainWindow.hide()
    569         self._statusIcon.mainWindowHidden()
    570579        return True
    571580
     
    575584            self._mainWindow.move(self._mainWindowX, self._mainWindowY)
    576585
    577         self._mainWindow.show()
     586        if pygobject:
     587            self._mainWindow.show()
     588        else:
     589            self._mainWindow.present()
    578590        self._mainWindow.deiconify()
    579591           
    580         self._statusIcon.mainWindowShown()
    581 
    582592    def toggleMainWindow(self):
    583593        """Toggle the main window."""
Note: See TracChangeset for help on using the changeset viewer.