a/src/desktop/hotrecoll.py b/src/desktop/hotrecoll.py
...
...
8
# path ("echo $PATH" to check what's in there), and then just enter
8
# path ("echo $PATH" to check what's in there), and then just enter
9
# its name as the action to perform, or copy it anywhere and copy the
9
# its name as the action to perform, or copy it anywhere and copy the
10
# full path as the action.
10
# full path as the action.
11
11
12
import gtk
12
import gtk
13
#import gtk.gdk
14
import wnck
13
import wnck
15
import os
14
import os
16
import sys
15
import sys
17
import time
18
19
16
20
def main():
17
def main():
21
    # We try to establish a timestamp for the calls to activate(), but
18
    # We try to establish a timestamp for the calls to activate(), but
22
    # usually fail (the event_peek() calls return None). 
19
    # usually fail (the event_peek() calls return None). 
23
    #
20
    #
24
    # Try to find a nice default value. The x server timestamp is
21
    # Try to find a nice default value. The x server timestamp is
25
    # millisecond from last reset, it wraps around in 49 days, half
22
    # millisecond from last reset, it wraps around in 49 days, half
26
    # the space is set aside for the past So a value just below 2**31
23
    # the space is set aside for the past So a value just below 2**31
27
    # should be considered recent in most situations ?
24
    # should be most recent if the server is not too old?
25
    # The right way to do this would probably be to create an unmapped
26
    # window and arrange to receive some real event.
28
    timestamp = 2**31 - 1
27
    timestamp = 2**31 - 1
29
    screen = wnck.screen_get_default()
28
    screen = wnck.screen_get_default()
30
    while gtk.events_pending():
29
    while gtk.events_pending():
31
        event = gtk.gdk.event_peek()
30
        event = gtk.gdk.event_peek()
32
        if event != None and event.get_time() != 0:
31
        if event != None and event.get_time() != 0: