Skip to content

Commit 4175419

Browse files
committed
Set WM_CLASS for X11
1 parent fcb3f79 commit 4175419

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

cobang/app.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from gettext import gettext as _
66
from urllib.parse import urlsplit
77
from urllib.parse import SplitResult as UrlSplitResult
8-
from typing import Optional, Tuple, Dict
8+
from typing import Optional, Tuple, Dict, List, cast
99

1010
import gi
1111
import zbar
@@ -82,10 +82,11 @@ class CoBangApplication(Gtk.Application):
8282
nm_client: Optional[NM.Client] = None
8383
g_event_sources: Dict[str, int] = {}
8484

85-
def __init__(self, *args, **kwargs):
85+
def __init__(self, **kwargs):
8686
super().__init__(
87-
*args, application_id=APP_ID, flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE, **kwargs
87+
application_id=APP_ID, flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
8888
)
89+
Gdk.set_program_class(APP_ID)
8990
self.add_main_option(
9091
'verbose', ord('v'), GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
9192
"More detailed log", None
@@ -200,8 +201,8 @@ def discover_webcam(self):
200201
bus: Gst.Bus = self.devmonitor.get_bus()
201202
logger.debug('Bus: {}', bus)
202203
bus.add_watch(GLib.PRIORITY_DEFAULT, self.on_device_monitor_message, None)
203-
devices = self.devmonitor.get_devices()
204-
for d in devices: # type: Gst.Device
204+
devices = cast(List[Gst.Device], self.devmonitor.get_devices())
205+
for d in devices:
205206
# Device is of private type GstV4l2Device or GstPipeWireDevice
206207
logger.debug('Found device {}', d.get_path_string())
207208
cam_name = d.get_display_name()

data/vn.hoabinh.quan.CoBang.appdata.xml.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
</kudos>
4646

4747
<releases>
48+
<release version="0.10.6" date="2024-03-25" urgency="medium">
49+
<description translatable="no">
50+
<p>Set WM_CLASS for X11.</p>
51+
</description>
52+
</release>
4853
<release version="0.10.5" date="2024-01-19" urgency="medium">
4954
<description translatable="no">
5055
<p>Update translation.</p>

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('cobang',
2-
version: '0.10.5',
3-
meson_version: '>= 0.53',
2+
version: '0.10.6',
3+
meson_version: '>= 0.61',
44
default_options: [
55
'warning_level=2',
66
],

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cobang"
3-
version = "0.10.5"
3+
version = "0.10.6"
44
description = "QR code and barcode scanner for Linux desktop"
55
authors = [
66
{name = "Nguyễn Hồng Quân", email = "[email protected]"},
@@ -24,9 +24,6 @@ repository = "https://github.com/hongquan/CoBang.git"
2424
[project.scripts]
2525
cobang = "cobang.__main__:main"
2626

27-
[tool.pdm]
28-
package-type = "application"
29-
3027
[tool.pdm.dev-dependencies]
3128
dev = [
3229
"pytest<8.0.0,>=7.2.0",
@@ -49,4 +46,3 @@ ignore = [
4946

5047
[tool.ruff.format]
5148
quote-style = "single"
52-

0 commit comments

Comments
 (0)