summaryrefslogtreecommitdiff
path: root/gtk-recordmydesktop/src/rmdSimple.py
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2009-06-05 16:26:52 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2009-06-05 16:26:52 +0000
commita155e9f88218060c207cf6a152d78b0e47fc7d2d (patch)
tree18146c1cf6e1c026e32edff8442092cc0d83c85d /gtk-recordmydesktop/src/rmdSimple.py
parent7395087031dc7ee82cb8b5c1ad2acbe455ba21f7 (diff)
Apply patch from Dominic Evans that fixes capturing of window
decorations when compiz is running. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@600 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'gtk-recordmydesktop/src/rmdSimple.py')
-rw-r--r--gtk-recordmydesktop/src/rmdSimple.py43
1 files changed, 35 insertions, 8 deletions
diff --git a/gtk-recordmydesktop/src/rmdSimple.py b/gtk-recordmydesktop/src/rmdSimple.py
index 1cdf17d..eb85b84 100644
--- a/gtk-recordmydesktop/src/rmdSimple.py
+++ b/gtk-recordmydesktop/src/rmdSimple.py
@@ -39,7 +39,9 @@ from rmdTrayIcon import *
import gtk.gdk
import gobject
import gc
+import sys
import re
+from subprocess import Popen,PIPE
import rmdPrefsWidget as pW
import rmdSelectThumb as sT
from rmdStrings import *
@@ -217,14 +219,39 @@ class simpleWidget(object):
self.__fileSelQuit__()
def __select_window__(self,button):
- xwininfo_com=['xwininfo','-frame']
- if self.values[21]==1:
- xwininfo_com=['xwininfo']
- (stdin,stdout,stderr)=os.popen3(xwininfo_com,'t')
- wid=stdout.readlines()
- stdin.close()
- stdout.close()
- stderr.close()
+ # check user has not disabled capture of window decoration
+ if self.values[21]!=1:
+ # else work out the size including decoration (also taking into account compiz)
+ p = Popen(['xwininfo','-frame'],stdout=PIPE)
+ pattern = re.compile('^xwininfo: Window id: (0x[0-9a-fA-F]+)')
+
+ while True:
+ o = p.stdout.readline()
+ if o == '' and p.poll() != None: break
+ match = pattern.search(o)
+ if match:
+ fid = match.group(1)
+ break
+
+ p = Popen(['xprop','-id',fid,'_NET_FRAME_WINDOW'],stdout=PIPE)
+ pattern = re.compile('^_NET_FRAME_WINDOW\(WINDOW\): window id # (0x[0-9a-fA-F]+)')
+
+ while True:
+ o = p.stdout.readline()
+ if o == '' and p.poll() != None: break
+ match = pattern.search(o)
+ if match:
+ wid = match.group(1)
+ break
+ else:
+ print pattern
+ print o
+
+ if wid: xwininfo_com = ['xwininfo','-id',wid]
+ else: xwininfo_com = ['xwininfo']
+ p = Popen(xwininfo_com,stdout=PIPE)
+ wid=p.stdout.readlines()
+
x=y=width=height=None
for i in wid:
if i.lstrip().startswith('Absolute upper-left X:'):
© All Rights Reserved