uh 1.1.1 → 1.2.0

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
- metadata.gz: 0efbb3383d315de3572ecf957001d7dfa7324c03
4
- data.tar.gz: ceaee1387cb5664f702c675a8009986a88e54eb0
3
+ metadata.gz: b3eb8222bf5b29246e0eac8a58b1f0e8de6efdf5
4
+ data.tar.gz: cf5c424c0a9abe939de622784f1c12d4ca4dbfc6
5
5
  SHA512:
6
- metadata.gz: d4f92d07c0f1356951d45e44544ca4b113f3f0e4efa5f8db2728b86d4db9f197e868786cd25a6b0eb027fbb1dbc9458dd2fbe372bf8d4a2820ffcaea3bf1d30b
7
- data.tar.gz: 9d09c9409e9c83a65ad950c151fd0ee832effd5537a0c47506381de23f5ff9c1f4727d4a3e742c22812a7d4062ef125a67060baa7b06949a34452763d8249d7e
6
+ metadata.gz: a70291650ca1a090d0993c4c6d4b7189db8159b685ec45c306d026745b7a62ab5f0151cc9bbf1e771fb57b371c58a8e1f8c6e1796852f9545562df3a335a3245
7
+ data.tar.gz: 40ebaee33dd8654e8dd3b9009d848e85d6e7fa41e368f62309d6a7a4911459f20cf36f121a27fb64b103b7fb9ef9d2b6a6529f23852c63ebcfe7e33f933191c4
@@ -35,7 +35,7 @@ VALUE display_close(VALUE self) {
35
35
  XCloseDisplay(DPY);
36
36
  }
37
37
  else {
38
- rb_raise(eDisplayError, "Can't close display");
38
+ rb_raise(eDisplayError, "cannot close display");
39
39
  }
40
40
 
41
41
  return self;
@@ -49,7 +49,7 @@ VALUE display_color_by_name(VALUE self, VALUE rcolor) {
49
49
  map = DefaultColormap(DPY, SCREEN_DEFAULT);
50
50
 
51
51
  if (!XAllocNamedColor(DPY, map, RSTRING_PTR(rcolor), &color, &color))
52
- rb_raise(rb_eArgError, "Invalid color name `%s'", RSTRING_PTR(rcolor));
52
+ rb_raise(rb_eArgError, "invalid color name `%s'", RSTRING_PTR(rcolor));
53
53
 
54
54
  return color_make(color.pixel);
55
55
  }
@@ -96,11 +96,11 @@ VALUE display_grab_key(VALUE self, VALUE key, VALUE modifier) {
96
96
 
97
97
  ks = XStringToKeysym(RSTRING_PTR(key));
98
98
  if (ks == NoSymbol)
99
- rb_raise(rb_eArgError, "Invalid KeySym %s", RSTRING_PTR(key));
99
+ rb_raise(rb_eArgError, "invalid KeySym %s", RSTRING_PTR(key));
100
100
 
101
101
  kc = XKeysymToKeycode(DPY, ks);
102
102
  if (kc == 0)
103
- rb_raise(rb_eArgError, "KeySym XK_%s has no KeyCode", RSTRING_PTR(key));
103
+ rb_raise(rb_eArgError, "keysym XK_%s has no keycode", RSTRING_PTR(key));
104
104
 
105
105
  XGrabKey(DPY, kc, FIX2INT(modifier), ROOT_DEFAULT, True,
106
106
  GrabModeAsync, GrabModeAsync);
@@ -142,7 +142,7 @@ VALUE display_open(VALUE self) {
142
142
  SET_DISPLAY(self);
143
143
 
144
144
  if (!(DPY = XOpenDisplay(NULL))) {
145
- rb_raise(eDisplayError, "Can't open display");
145
+ rb_raise(eDisplayError, "cannot open display");
146
146
  }
147
147
 
148
148
  XSetErrorHandler(display_x_error_handler);
data/lib/uh.rb CHANGED
@@ -5,6 +5,7 @@ require 'uh/events'
5
5
  require 'uh/events/event'
6
6
  require 'uh/font'
7
7
  require 'uh/geo'
8
+ require 'uh/geo_accessors'
8
9
  require 'uh/pixmap'
9
10
  require 'uh/screen'
10
11
  require 'uh/version'
@@ -1,5 +1,9 @@
1
1
  module Uh
2
2
  class Display
3
+ def to_s
4
+ ENV['DISPLAY']
5
+ end
6
+
3
7
  def create_subwindow(geo)
4
8
  root.create_sub geo
5
9
  end
@@ -1,3 +1,5 @@
1
+ require 'forwardable'
2
+
1
3
  module Uh
2
4
  module GeoAccessors
3
5
  extend Forwardable
@@ -1,3 +1,3 @@
1
1
  module Uh
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
@@ -23,10 +23,17 @@ module Uh
23
23
 
24
24
  def execute(command)
25
25
  log "Spawn `#{command}`"
26
- pid = spawn command, pgroup: true
27
- Process.detach pid
28
- rescue Errno::ENOENT => e
29
- log_error "Spawn: #{e}"
26
+ pid = fork do
27
+ fork do
28
+ Process.setsid
29
+ begin
30
+ exec command
31
+ rescue Errno::ENOENT => e
32
+ log_error "Spawn: #{e}"
33
+ end
34
+ end
35
+ end
36
+ Process.waitpid pid
30
37
  end
31
38
 
32
39
  def log_layout
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-21 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -142,4 +142,3 @@ test_files:
142
142
  - test/uh/test_wm.rb
143
143
  - test/uh/wm/test_client.rb
144
144
  - test/uh/wm/test_manager.rb
145
- has_rdoc: