From aeab72f72473c736b9c4796b7d60078a919938bd Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Wed, 15 Oct 2014 14:51:44 +0200 Subject: [PATCH 1/4] Apply patch from https://github.com/synergy/synergy/issues/3749 --- src/lib/platform/XWindowsScreen.cpp | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index a3e12fde..15f1385c 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -1782,29 +1782,32 @@ CXWindowsScreen::doSelectEvents(Window w) const // that we select PointerMotionMask on every window. we also select // SubstructureNotifyMask in order to get CreateNotify events so we // select events on new windows too. - // - // note that this can break certain clients due a design flaw of X. - // X will deliver a PointerMotion event to the deepest window in the - // hierarchy that contains the pointer and has PointerMotionMask - // selected by *any* client. if another client doesn't select - // motion events in a subwindow so the parent window will get them - // then by selecting for motion events on the subwindow we break - // that client because the parent will no longer get the events. - - // FIXME -- should provide some workaround for event selection - // design flaw. perhaps only select for motion events on windows - // that already do or are top-level windows or don't propagate - // pointer events. or maybe an option to simply poll the mouse. // we don't want to adjust our grab window if (w == m_window) { return; } + // X11 has a design flaw. If *no* client selected PointerMotionMask for + // a window, motion events will be delivered to that window's parent. + // If *any* client, not necessarily the owner, selects PointerMotionMask + // on such a window, X will stop propagating motion events to its + // parent. This breaks applications that rely on event propagation + // behavior. + // + // Avoid selecting PointerMotionMask unless some other client selected + // it already. + long mask = SubstructureNotifyMask; + XWindowAttributes attr; + XGetWindowAttributes(m_display, w, &attr); + if ((attr.all_event_masks & PointerMotionMask) == PointerMotionMask) { + mask |= PointerMotionMask; + } + // select events of interest. do this before querying the tree so // we'll get notifications of children created after the XQueryTree() // so we won't miss them. - XSelectInput(m_display, w, PointerMotionMask | SubstructureNotifyMask); + XSelectInput(m_display, w, mask); // recurse on child windows Window rw, pw, *cw; From c18411b9a4d53d31820dfba6cc2836dcab832623 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Wed, 22 Oct 2014 13:55:39 +0100 Subject: [PATCH 2/4] added branch name to package names now that buildbot builds branches, it'll be handy to see that branch name in the package name. --- ext/toolchain/commands1.py | 40 ++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 0540bcb4..8888b7bb 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -946,17 +946,32 @@ class InternalCommands: def getGitRevision(self): if sys.version_info < (2, 4): raise Exception("Python 2.4 or greater required.") - else: - p = subprocess.Popen( - ["git", "log", "--pretty=format:%h", "-n", "1"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - stdout, stderr = p.communicate() - - if p.returncode != 0: - raise Exception('Could not get revision - git info failed with code: ' + str(p.returncode)) - return stdout + p = subprocess.Popen( + ["git", "log", "--pretty=format:%h", "-n", "1"], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + stdout, stderr = p.communicate() + + if p.returncode != 0: + raise Exception('Could not get revision, git error: ' + str(p.returncode)) + + return stdout.strip() + + def getGitBranchName(self): + if sys.version_info < (2, 4): + raise Exception("Python 2.4 or greater required.") + + p = subprocess.Popen( + ["git", "rev-parse", "--abbrev-ref", "HEAD"], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + stdout, stderr = p.communicate() + + if p.returncode != 0: + raise Exception('Could not get branch name, git error: ' + str(p.returncode)) + + return stdout.strip() def find_revision_svn(self): if sys.version_info < (2, 4): @@ -1422,9 +1437,10 @@ class InternalCommands: def dist_name_rev(self, type): # find the version number (we're puting the rev in after this) pattern = '(.*\d+\.\d+\.\d+)(.*)' - replace = '\g<1>-' + self.find_revision() + '\g<2>' + replace = "\g<1>-%s@%s\g<2>" % ( + self.getGitBranchName(), self.getGitRevision()) return re.sub(pattern, replace, self.dist_name(type)) - + def dist_usage(self): print ('Usage: %s package [package-type]\n' '\n' From 420ac24b0b60ac81ebafae88536d563ee35a0f35 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Wed, 22 Oct 2014 14:06:15 +0100 Subject: [PATCH 3/4] fixed "hm dist src" command to support branches also allowed non-unix platforms to run src --- ext/toolchain/commands1.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 8888b7bb..04ac8c96 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -1019,10 +1019,7 @@ class InternalCommands: moveExt = '' if type == 'src': - if sys.platform in ['linux2', 'darwin']: - self.distSrc() - else: - package_unsupported = True + self.distSrc() elif type == 'rpm': if sys.platform == 'linux2': @@ -1206,11 +1203,15 @@ class InternalCommands: print "Removing existing export..." shutil.rmtree(exportPath) - print 'Exporting repository to: ' + exportPath os.mkdir(exportPath) - err = os.system('git archive master | tar -x -C ' + exportPath) + + cmd = "git archive %s | tar -x -C %s" % ( + self.getGitBranchName(), exportPath) + + print 'Exporting repository to: ' + exportPath + err = os.system(cmd) if err != 0: - raise Exception('Repository export failed: ' + str(err)) + raise Exception('Repository export failed: ' + str(err)) packagePath = '../' + self.getGenerator().binDir + '/' + name + '.tar.gz' From 072e03c6ce73ab5a76241b9af1aecce20b7abc41 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Wed, 22 Oct 2014 14:56:57 +0100 Subject: [PATCH 4/4] changed @ to - in package name --- ext/toolchain/commands1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 04ac8c96..1eee3a41 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -1438,7 +1438,7 @@ class InternalCommands: def dist_name_rev(self, type): # find the version number (we're puting the rev in after this) pattern = '(.*\d+\.\d+\.\d+)(.*)' - replace = "\g<1>-%s@%s\g<2>" % ( + replace = "\g<1>-%s-%s\g<2>" % ( self.getGitBranchName(), self.getGitRevision()) return re.sub(pattern, replace, self.dist_name(type))