[PATCH] Fix for Bug #417278



I've never used git before, so please let me know if I'm doing things
incorrectly. This is the patch email that was produced by

git format-patch -1 -s

so I believe that I can send it to this email, and then someone can commit
it to the git hub version? There is a decent sized comment in the
code which explains why I think this fixes the problem. It works for
me and I am on Ubuntu Lucid with all the fancy stuff enabled in
compiz.

Cheers,
Gerard

Signed-off-by: Gerard Brunick <gbrunick gmail com>
---
kupfer/ui/browser.py | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/kupfer/ui/browser.py b/kupfer/ui/browser.py
index 7333610..fb38997 100644
--- a/kupfer/ui/browser.py
+++ b/kupfer/ui/browser.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
+
+# gb: emacs 23.2 doesnt like upper case UTF-8?

import itertools
import os
@@ -1581,6 +1583,27 @@ class WindowController (pretty.OutputMixin):
if self._should_recenter_window():
self._center_window()
self.window.stick()
+ # gb: The window manager generally maps a window onto the
+ # screen asyncronously (i.e. sometimes after the methods
+ # self.window.show() or self.window.present_at_time() have
+ # returned to this function). Some window managers
+ # (e.g. Compiz) seem to move the window by the size of its
+ # decoration (i.e. title and frame) when the window changes
+ # from hidden to shown. Unfortunately, the behaviour seems
+ # rather random, and it is seems to be hard to predicate
+ # whether this will occur on the next call to
+ # self.window.present_with_time or not. As a result, there is
+ # little we can do to work around this behaviour it until it
+ # has already occured. The method self.window.show_now
+ # actually enters the event loop and waits for the window to
+ # be mapped, so we can see what the window manager did and
+ # make any necessary corrections after this function returns.
+ # An alternative solution is to install a timer and see
+ # whether the window has moved in say 100 ms, but using
+ # show_now seems to produce less flicker.
+ x, y = self.window.get_position()
+ self.window.show_now()
+ self.window.move(x, y)
self.window.present_with_time(time)
self.window.window.focus(timestamp=time)
self.interface.focus()
@@ -1766,3 +1789,9 @@ class WindowController (pretty.OutputMixin):
if gtk.events_pending():
self.output_info("Waiting for tasks to finish...")
do_main_iterations()
+
+
+# Local Variables:
+# indent-tabs-mode: t
+# python-indent: 4
+# End:
--
1.7.0.4

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]