OSDN Git Service

updates
authorshy <shy>
Sun, 11 Jun 2006 10:43:47 +0000 (10:43 +0000)
committershy <shy>
Sun, 11 Jun 2006 10:43:47 +0000 (10:43 +0000)
ChangeLog
lib/ninix/surface.py

index 055adff..08d39b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Fri June 9 2006   Shyouzou Sugitani <shy@users.sourceforge.jp>
+Sun June 11 2006   Shyouzou Sugitani <shy@users.sourceforge.jp>
+       * バージョン3.8.7リリース.
+
+Sat June 10 2006   Shyouzou Sugitani <shy@users.sourceforge.jp>
        * ゴーストのサーフェスのマウスドラッグによる移動に
        gtk.Window.begin_move_drag()を使用するように変更.
        使用しているウインドウマネージャによっては画面外に出せなく
index 5e5e6b3..dcb8519 100644 (file)
@@ -680,15 +680,11 @@ class Surface:
         for window in self.window:
             window.window.set_icon(pixbuf)
 
-    def __reset_position(self, side): # XXX
-        self.window[side].reset_position()
-
     def __check_mikire_kasanari(self):
         if not self.is_shown(0):
             self.__mikire = 0
             self.__kasanari = 0
             return
-        self.__reset_position(0)
         scrn_w = gtk.gdk.screen_width()
         scrn_h = gtk.gdk.screen_height()
         x0, y0 = self.get_position(0)
@@ -699,7 +695,6 @@ class Surface:
         else:
             self.__mikire = 0
         if self.is_shown(1):
-            self.__reset_position(1)
             x1, y1 = self.get_position(1)
             s1w, s1h = self.get_surface_size(1)
             if (x0 < x1 + s1w / 2 < x0 + s0w and y0 < y1 + s1h / 2 < y0 + s0h) or \
@@ -816,7 +811,7 @@ class SurfaceWindow:
         self.__scale = 100 # %
         self.__use_pna = use_pna
         self.__alpha_channel = alpha
-        self.__boot = 0
+        self.__position_dirty = False
         if self.alias is not None:
             default_id = self.alias.get(default_id, [default_id])[0]
         self.surface = surface
@@ -833,6 +828,7 @@ class SurfaceWindow:
         self.window_offset = (0, 0)
         self.set_position(0, 0)
         self.set_direction(0)
+        self.window.connect('leave_notify_event', self.window_leave_notify) # XXX
         # create drawing area
         self.darea = gtk.DrawingArea()
         self.darea.show()
@@ -1272,11 +1268,7 @@ class SurfaceWindow:
     def show(self):
         if not self.__shown:
             self.darea.show()
-            if self.__boot == 0:
-                self.__boot = 1
-                self.window.show_now() # XXX
-            else:
-                self.window.show()
+            self.window.show()
             self.__move()
             self.__shown = 1
 
@@ -1301,6 +1293,7 @@ class SurfaceWindow:
             y = int(y * 100 / self.__scale)
         if event.button == 2:
             if event.type == gtk.gdk.BUTTON_PRESS:
+                self.__position_dirty = True
                 self.window.begin_move_drag(
                     event.button, int(event.x_root), int(event.y_root),
                     gtk.get_current_event_time())
@@ -1364,7 +1357,10 @@ class SurfaceWindow:
             self.mayuna_cache = {}
             self.reset_surface()
 
-    def reset_position(self):
+    def window_leave_notify(self, window, event):
+        if not self.__position_dirty:
+            return
+        self.__position_dirty = False
         x, y = self.window.get_position()
         p, q = self.window_offset
         w, h = self.get_surface_size()