Skip to content

Commit

Permalink
Set WM_CLASS for X11
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquan committed Mar 25, 2024
1 parent fcb3f79 commit 4175419
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
11 changes: 6 additions & 5 deletions cobang/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from gettext import gettext as _
from urllib.parse import urlsplit
from urllib.parse import SplitResult as UrlSplitResult
from typing import Optional, Tuple, Dict
from typing import Optional, Tuple, Dict, List, cast

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

def __init__(self, *args, **kwargs):
def __init__(self, **kwargs):
super().__init__(
*args, application_id=APP_ID, flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE, **kwargs
application_id=APP_ID, flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
)
Gdk.set_program_class(APP_ID)
self.add_main_option(
'verbose', ord('v'), GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
"More detailed log", None
Expand Down Expand Up @@ -200,8 +201,8 @@ def discover_webcam(self):
bus: Gst.Bus = self.devmonitor.get_bus()
logger.debug('Bus: {}', bus)
bus.add_watch(GLib.PRIORITY_DEFAULT, self.on_device_monitor_message, None)
devices = self.devmonitor.get_devices()
for d in devices: # type: Gst.Device
devices = cast(List[Gst.Device], self.devmonitor.get_devices())
for d in devices:
# Device is of private type GstV4l2Device or GstPipeWireDevice
logger.debug('Found device {}', d.get_path_string())
cam_name = d.get_display_name()
Expand Down
5 changes: 5 additions & 0 deletions data/vn.hoabinh.quan.CoBang.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
</kudos>

<releases>
<release version="0.10.6" date="2024-03-25" urgency="medium">
<description translatable="no">
<p>Set WM_CLASS for X11.</p>
</description>
</release>
<release version="0.10.5" date="2024-01-19" urgency="medium">
<description translatable="no">
<p>Update translation.</p>
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('cobang',
version: '0.10.5',
meson_version: '>= 0.53',
version: '0.10.6',
meson_version: '>= 0.61',
default_options: [
'warning_level=2',
],
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cobang"
version = "0.10.5"
version = "0.10.6"
description = "QR code and barcode scanner for Linux desktop"
authors = [
{name = "Nguyễn Hồng Quân", email = "[email protected]"},
Expand All @@ -24,9 +24,6 @@ repository = "https://github.com/hongquan/CoBang.git"
[project.scripts]
cobang = "cobang.__main__:main"

[tool.pdm]
package-type = "application"

[tool.pdm.dev-dependencies]
dev = [
"pytest<8.0.0,>=7.2.0",
Expand All @@ -49,4 +46,3 @@ ignore = [

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

0 comments on commit 4175419

Please sign in to comment.