Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-x11 for openSUSE:Factory checked in at 2021-02-26 21:57:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-x11 (Old) and /work/SRC/openSUSE:Factory/.yast2-x11.new.2378 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-x11" Fri Feb 26 21:57:55 2021 rev:19 rq:869734 version:4.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-x11/yast2-x11.changes 2018-12-31 09:41:42.642446448 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-x11.new.2378/yast2-x11.changes 2021-02-26 21:57:56.291741080 +0100 @@ -1,0 +2,8 @@ +Fri Feb 5 09:35:45 UTC 2021 - Ladislav Slez??k <[email protected]> + +- Added "active_window" for switching the current X window + (or restoring back the previously active window) + (jsc#PM-1895, jsc#SLE-16263) +- 4.3.0 + +------------------------------------------------------------------- Old: ---- yast2-x11-4.1.0.tar.bz2 New: ---- yast2-x11-4.3.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-x11.spec ++++++ --- /var/tmp/diff_new_pack.w7dzej/_old 2021-02-26 21:57:56.799741526 +0100 +++ /var/tmp/diff_new_pack.w7dzej/_new 2021-02-26 21:57:56.803741530 +0100 @@ -1,7 +1,7 @@ # # spec file for package yast2-x11 # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: yast2-x11 -Version: 4.1.0 +Version: 4.3.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -35,7 +35,7 @@ Summary: YaST2 - X11 support License: GPL-2.0-only Group: System/YaST -Url: http://github.com/yast/yast-x11/ +URL: http://github.com/yast/yast-x11/ Supplements: packageand(yast2-installation:xorg-x11-server) Obsoletes: sax2-tools <= 8.1 @@ -54,6 +54,7 @@ %files %defattr(-,root,root) +%{yast_ybindir}/active_window %{yast_ybindir}/testX %{yast_ybindir}/set_videomode /usr/sbin/xkbctrl ++++++ yast2-x11-4.1.0.tar.bz2 -> yast2-x11-4.3.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/.github/workflows/ci.yml new/yast2-x11-4.3.0/.github/workflows/ci.yml --- old/yast2-x11-4.1.0/.github/workflows/ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-x11-4.3.0/.github/workflows/ci.yml 2021-02-05 13:08:28.000000000 +0100 @@ -0,0 +1,25 @@ + +# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions + +name: CI + +on: [push, pull_request] + +jobs: + Package: + runs-on: ubuntu-latest + container: registry.opensuse.org/yast/head/containers/yast-cpp:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Prepare System + run: | + zypper --non-interactive in --no-recommends \ + xorg-x11-libX11-devel \ + xorg-x11-libXmu-devel + + - name: Package Build + run: yast-ci-cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/.travis.yml new/yast2-x11-4.3.0/.travis.yml --- old/yast2-x11-4.1.0/.travis.yml 2018-11-29 16:47:49.000000000 +0100 +++ new/yast2-x11-4.3.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -sudo: required -language: bash -services: - - docker - -before_install: - - docker build -t yast-x11-image . -script: - # the "yast-travis-cpp" script is included in the base yastdevel/cpp image - # see https://github.com/yast/docker-yast-cpp/blob/master/yast-travis-cpp - - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-x11-image yast-travis-cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/CONTRIBUTING.md new/yast2-x11-4.3.0/CONTRIBUTING.md --- old/yast2-x11-4.1.0/CONTRIBUTING.md 2018-11-29 16:47:49.000000000 +0100 +++ new/yast2-x11-4.3.0/CONTRIBUTING.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,89 +0,0 @@ -YaST Contribution Guidelines -============================ - -YaST is an open source project and as such it welcomes all kinds of -contributions. If you decide to contribute, please follow these guidelines to -ensure the process is effective and pleasant both for you and the YaST maintainers. - -There are two main forms of contribution: reporting bugs and performing code -changes. - -Bug Reports ------------ - -If you find a problem, please report it either using -[Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2) -or [GitHub issues](../../issues). (For Bugzilla, use the [simplified -registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp) -if you don't have an account yet.) - -When creating a bug report, please follow our [bug reporting -guidelines](http://en.opensuse.org/openSUSE:Report_a_YaST_bug). - -We can't guarantee that every bug will be fixed, but we'll try. - -Code Changes ------------- - -We welcome all kinds of code contributions, from simple bug fixes to significant -refactorings and implementation of new features. However, before making any -non-trivial contribution, get in touch with us first ??? this can prevent wasted -effort on both sides. Also, have a look at our [development -documentation](http://en.opensuse.org/openSUSE:YaST_development). - -To send us your code change, use GitHub pull requests. The workflow is as -follows: - - 1. Fork the project. - - 2. Create a topic branch based on `master`. - - 3. Implement your change, including tests (if possible). Make sure you adhere - to the [Ruby style - guide](https://github.com/SUSE/style-guides/blob/master/Ruby.md). - - 4. Update the package version (in `packages/*.spec`, usually by - `rake version:bump`) and add a new entry to the `package/*.changes` file - (by `osc vc package`). - For bigger changes or changes which need longer discussion it is advised to - add this as a separate last commit so it can be easily updated when another - change is merged in the meantime. - - 5. Make sure your change didn't break anything by building the RPM package - (`rake osc:build`). The build process includes running the full testsuite. - - 6. Publish the branch and create a pull request. - - 7. YaST developers will review your change and possibly point out issues. - Adapt the code under their guidance until they are all resolved. - - 8. Finally, the pull request will get merged or rejected. - -See also [GitHub's guide on -contributing](https://help.github.com/articles/fork-a-repo). - -If you want to do multiple unrelated changes, use separate branches and pull -requests. - -### Commits - -Each commit in the pull request should do only one thing, which is clearly -described by its commit message. Especially avoid mixing formatting changes and -functional changes into one commit. When writing commit messages, adhere to -[widely used -conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). - -If your commit is related to a bug in Bugzilla or an issue on GitHub, make sure -you mention it in the commit message for cross-reference. Use format like -bnc#775814 or gh#yast/yast-foo#42. See also [GitHub -autolinking](https://help.github.com/articles/github-flavored-markdown#references) -and [openSUSE abbreviation -reference](http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines#Current_set_of_abbreviations). - -Additional Information ----------------------- - -If you have any question, feel free to ask at the [development mailing -list](http://lists.opensuse.org/yast-devel/) or at the -[#yast](http://webchat.freenode.net/?channels=%23yast) IRC channel on freenode. -We'll do our best to provide a timely and accurate answer. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/Dockerfile new/yast2-x11-4.3.0/Dockerfile --- old/yast2-x11-4.1.0/Dockerfile 2018-11-29 16:47:49.000000000 +0100 +++ new/yast2-x11-4.3.0/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -FROM yastdevel/cpp -RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \ - xorg-x11-libX11-devel \ - xorg-x11-libXmu-devel - -COPY . /usr/src/app - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/README.md new/yast2-x11-4.3.0/README.md --- old/yast2-x11-4.1.0/README.md 2018-11-29 16:47:49.000000000 +0100 +++ new/yast2-x11-4.3.0/README.md 2021-02-05 13:08:28.000000000 +0100 @@ -1,5 +1,7 @@ # YaST - X11 Tools and Configs # -[](https://travis-ci.org/yast/yast-x11) -[](https://ci.opensuse.org/view/Yast/job/yast-x11-master/) +[]( +https://github.com/yast/yast-x11/actions?query=branch%3Amaster) +[]( +https://ci.opensuse.org/view/Yast/job/yast-yast-x11-master/) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/package/yast2-x11.changes new/yast2-x11-4.3.0/package/yast2-x11.changes --- old/yast2-x11-4.1.0/package/yast2-x11.changes 2018-11-29 16:47:49.000000000 +0100 +++ new/yast2-x11-4.3.0/package/yast2-x11.changes 2021-02-05 13:08:28.000000000 +0100 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Feb 5 09:35:45 UTC 2021 - Ladislav Slez??k <[email protected]> + +- Added "active_window" for switching the current X window + (or restoring back the previously active window) + (jsc#PM-1895, jsc#SLE-16263) +- 4.3.0 + +------------------------------------------------------------------- Thu Nov 29 15:33:42 UTC 2018 - [email protected] - Explicitly depend on the new yast2-theme, the old yast2_theme diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/package/yast2-x11.spec new/yast2-x11-4.3.0/package/yast2-x11.spec --- old/yast2-x11-4.1.0/package/yast2-x11.spec 2018-11-29 16:47:49.000000000 +0100 +++ new/yast2-x11-4.3.0/package/yast2-x11.spec 2021-02-05 13:08:28.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-x11 -Version: 4.1.0 +Version: 4.3.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -50,6 +50,7 @@ %files %defattr(-,root,root) +%{yast_ybindir}/active_window %{yast_ybindir}/testX %{yast_ybindir}/set_videomode /usr/sbin/xkbctrl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/src/tools/Makefile.am new/yast2-x11-4.3.0/src/tools/Makefile.am --- old/yast2-x11-4.1.0/src/tools/Makefile.am 2018-11-29 16:47:49.000000000 +0100 +++ new/yast2-x11-4.3.0/src/tools/Makefile.am 2021-02-05 13:08:28.000000000 +0100 @@ -2,7 +2,7 @@ # Makefile.am for x11/src/tools # -ybin_PROGRAMS = testX +ybin_PROGRAMS = testX active_window ybin_SCRIPTS = set_videomode @@ -16,4 +16,10 @@ testX_LDFLAGS = \ -L/usr/X11R6/lib -L/usr/X11R6/lib64 -lX11 -lXmu +active_window_SOURCES = \ + active_window.c + +active_window_LDFLAGS = \ + -L/usr/X11R6/lib -L/usr/X11R6/lib64 -lX11 + EXTRA_DIST = $(sbin_SCRIPTS) $(man_MANS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-x11-4.1.0/src/tools/active_window.c new/yast2-x11-4.3.0/src/tools/active_window.c --- old/yast2-x11-4.1.0/src/tools/active_window.c 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-x11-4.3.0/src/tools/active_window.c 2021-02-05 13:08:28.000000000 +0100 @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2021 SUSE LLC + * + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + **/ + +/** + * This tool reads or sets the active window. It can be used for restoring back + * the currently active window later. + * + * Usage: + * + * active_window [WID] + * + * Without any parameter it prints the active window ID, with a parameter + * it activates and raises the window with that ID [WID]. + * + * + * It uses the Extended Window Manager Hints (EWMH) to read and set the active window. + * The IceWM used in the installer supports this. + * + * Resources, links: + * + * - man pages for XOpenDisplay, XGetWindowProperty and other Xlib calls + * - https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html + * - https://github.com/leahneukirchen/tools/blob/490cf61021a5d73202f260229d6157d4d11341f3/wmtitle.c + * - https://stackoverflow.com/questions/30192347/how-to-restore-a-window-with-xlib + * - https://stackoverflow.com/questions/31800880/xlib-difference-between-net-active-window-and-xgetinputfocus + * - https://github.com/jordansissel/xdotool/blob/dd45db42f16954f22b445a2c2c928fec202314c4/xdo.c#L686 + **/ + +#include <stdio.h> +#include <stdlib.h> + +#include <X11/Xlib.h> + +int main(int argc, char **argv) { + // connect to the X server, NULL = use the $DISPLAY env + Display *display = XOpenDisplay(NULL); + if (!display) { + return(1); + } + + Window root = XDefaultRootWindow(display); + // this is the WM property for the currently active window + Atom property = XInternAtom(display, "_NET_ACTIVE_WINDOW", False); + + // an argument has been passed, activate the requested window + if (argc > 1) + { + // convert the argument to a window + Window window = (Window)strtoul(argv[1], NULL, 0); + + // build an X event, see the links at the top + XClientMessageEvent ev; + ev.type = ClientMessage; + ev.window = window; + ev.message_type = property; + ev.format = 32; + ev.data.l[0] = 1; + ev.data.l[1] = CurrentTime; + ev.data.l[2] = 0; + ev.data.l[3] = 0; + ev.data.l[4] = 0; + + // send it to the X server + XSendEvent(display, root, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent*) &ev); + // wait until it is processed + XSync(display, False); + } + // read mode, print the currently active window + else + { + // build the parameters for reading the WM property + long offset = 0; + long length = ~0; + Bool delete = False; + Atom req_type = AnyPropertyType; + Atom actual_type_return; + + int actual_format_return; + unsigned long nitems_return; + unsigned long bytes_after_return; + unsigned char *prop_return; + + // read the property, see the links at the top + if (XGetWindowProperty(display, root, property, offset, length, delete, + req_type, &actual_type_return, &actual_format_return, + &nitems_return, &bytes_after_return, &prop_return) != Success) + { + XCloseDisplay(display); + return(1); + } + + // print the window ID + printf("%lu\n", *(unsigned long *) prop_return); + XFree(prop_return); + } + + XCloseDisplay(display); + return 0; +}
