显然这不是Wayland核心协议的一部分,但我使用的是Weston,xdg-shell扩展似乎有必要的方法:
xdg_surface_set_window_geometry
所以我跑去wayland-scanner创建xdg代码和头文件:
wayland-scanner code < ./weston-1.6.0/protocol/xdg-shell.xml > xdg_shell.c
wayland-scanner client-header < ./weston-1.6.0/protocol/xdg-shell.xml > xdg_shell.h
我正在使用的代码大致如下:
surface = wl_compositor_create_surface(compositor);
if(surface == NULL) {
...
}
native_window = wl_egl_window_create(surface, some_width, some_height);
if(native_window == NULL) {
...
}
_xdg_surface = xdg_shell_get_xdg_surface(_xdg_shell, surface);
xdg_surface_set_window_geometry(_xdg_surface, 0, 0, some_width, some_height);
Run Code Online (Sandbox Code Playgroud)
代码运行没有错误但什么都不做.我正在使用Wayland和Weston的包裹运行Debian Jessie.
如果除此之外的其他方法xdg_shell可行,我全都耳朵.
所以在C和C ++中,我一直在使用prctl(PR_SET_PDEATHSIG,SIGKILL); 而且效果很好。当我在shell脚本中生成子进程时,我会使用如下代码:
pid=$!
trap "kill $pid" SIGHUP SIGINT SIGTERM
wait
Run Code Online (Sandbox Code Playgroud)
这在所有情况下工作,除了当shell脚本得到一个SIGKILL(它不能赶上)。然后,我最终得到了外壳脚本的子级为僵尸。
Shell脚本是否可以将SIGKILL传递给其子级?我对适用于哪种外壳很开放,但理想情况下是bash或sh。
因此,基于下面的评论,我将提供一些背景知识,看看我是否应该完全使用其他方法。我们的设置大致遵循以下原则:
+ systemd
+ a_c_process
+ a_c_process
+ a_c_process
+ a_leaf_c_process
+ shellscriptA
+ a_leaf_c_process
+ a_leaf_c_process
Run Code Online (Sandbox Code Playgroud)
因此,尽管SIGTERM可以作为我们的开始信号(例如,任何非叶子c进程都可以在收到SIGTERM时将SIGTERM发送给它的所有子进程),但是如果树中的进程不能正确处理SIGTERM,我的理解是我应该期望系统化提供一个SIGKILL。我们一直在使用PR_SET_PDEATHSIG来确保清除整个进程树中的僵尸。
从我可以看到的角度来看,该技术应该能够与SIGTERM处理并存。也就是说,我可以安装SIGTERM处理程序,但是如果这些处理程序失败,也可以使用PR_SET_DEATHSIG作为后备。
我已经部分工作,但我面临几个困难:
1)看来QWebEnginePage需要QWebEngineView。(请参阅此处的 setView() 方法:https://code.woboq.org/qt5/qtwebengine/src/webenginewidgets/api/qwebenginepage.cpp.html)
2) QWebEngineView 除非可见,否则不会呈现。
3) 似乎没有任何方法可以检测视图的哪些区域受到了影响。
我想确认一下新 API 是否可以做到这一点?旧的 QT WebKit API 提供了一种实现此目的的方法。
我创建了一个带有 Mocha 测试的 vue3 cli 项目:
vue create vue_proj_with_mocha_testing
(accept defaults)
cd vue_proj_with_mocha_testing
vue add unit-mocha
Run Code Online (Sandbox Code Playgroud)
然后在 Visual Code 中安装 Mocha 测试资源管理器扩展,重新启动,将文件夹添加到工作区,单击文件夹,ctrl-shift-p 和 Mocha 测试资源管理器:“启用工作区文件夹”。开箱即用的 Mocha 测试资源管理器似乎不喜欢 vuecli 的 example.spec.js 测试:
import { expect } from 'chai'
import { shallowMount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld.vue'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
const wrapper = shallowMount(HelloWorld, {
propsData: { msg }
})
expect(wrapper.text()).to.include(msg)
})
})
Run Code Online (Sandbox Code Playgroud)
我将此条目添加到 settings.json 以便测试资源管理器找到 vue …
我有这样的东西,但对于大集合来说,速度非常慢:
let unionize = (triangles) => {
if(triangles.length == 0) {
return null
}
let ret = triangles[0].feature
triangles.forEach((t, index) => {
if(index > 0) {
ret = turf.union(t, t)
}
})
return ret
}
Run Code Online (Sandbox Code Playgroud) 有人可以粘贴一对使用rtpvrawpay和的有效 gst-launch 管道rtpvrawdepay吗?
这是我的第一次尝试:
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,width=128,height=128,format=BGR ! rtpvrawpay ! application/x-rtp,payload=96 ! udpsink host=... port=...
gst-launch-1.0 udpsrc port=9999 ! application/x-rtp,media=video,payload=96,clock-rate=90000,encoding-name=RAW,sampling=BGR,depth=16 ! rtpvrawdepay ! video/x-raw,width=128,height=128,format=BGR,framerate=30/1 ! videoconvert ! ximagesink