movewin 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- data.tar.gz: ec2cca34dab2420bdb554f23048fb78fdaf79896
4
- metadata.gz: 18f6fcbe38d203cc912c2aa9bd88aa20f320a4d7
3
+ metadata.gz: a193b21672c8447a18c0d52b7d8c46acc72e4848
4
+ data.tar.gz: 110afbc6ef126e64dc154b0a70ebd2f21d6fb837
5
5
  SHA512:
6
- data.tar.gz: 6cddcf1dccd2db60492e6da76cf1295f42312cbe2a86c3d3af4aed313e6acb6cad4b17a97980c856a6361e07fb66e751f16884c0e5d6c5337bfced9dbe5c21e3
7
- metadata.gz: 677a6c4e31858049864754f19ca139413b458ac13d785224f557cb25f718ad88a95b5e8a7b07663b1af6be4d4b88f8add1e13f79a46bb9cacef8e3f013cc9729
6
+ metadata.gz: 8e0f530fe1b99eaa8d1b98c7b49b6f2125937856859280f351d757b261ae60b5170393f7b07f48540a1d790cf7aa12b45318c1728d6818a7ee2d6c1138dc2160
7
+ data.tar.gz: 1eba09edc9672467643e5b3ab1cb4e0aebe77f4712038cba21253d6bf9c31511b3e2d57048b8b97d828ea297cfc23dde9fd875889d0c2913f5166c92393de6ea
@@ -74,8 +74,11 @@ int EnumerateWindows(
74
74
  if(layer > 0) continue;
75
75
 
76
76
  /* Turn application name and title into string to match against */
77
+ appName = windowName = title = NULL;
77
78
  appName = CFDictionaryCopyCString(window, kCGWindowOwnerName);
79
+ if(!appName || !*appName) goto skip;
78
80
  windowName = CFDictionaryCopyCString(window, kCGWindowName);
81
+ if(!windowName || !*windowName) goto skip;
79
82
  titleSize = strlen(appName) + strlen(" - ") + strlen(windowName) + 1;
80
83
  title = (char *)malloc(titleSize);
81
84
  snprintf(title, titleSize, "%s - %s", appName, windowName);
@@ -86,9 +89,10 @@ int EnumerateWindows(
86
89
  count++;
87
90
  }
88
91
 
89
- free(title);
90
- free(windowName);
91
- free(appName);
92
+ skip:
93
+ if(title) free(title);
94
+ if(windowName) free(windowName);
95
+ if(appName) free(appName);
92
96
  }
93
97
  if(subPattern != pattern) free(subPattern);
94
98
 
data/lib/movewin.rb CHANGED
@@ -36,7 +36,7 @@
36
36
  require 'movewin/movewin_ext'
37
37
 
38
38
  module MoveWin
39
- VERSION = '1.1'
39
+ VERSION = '1.2'
40
40
 
41
41
  # Individual accessors for display size components
42
42
  def self.display_width; MoveWin.display_size[0]; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: movewin
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.1"
4
+ version: "1.2"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Ho