WM_CLASS vs WM_INSTANCE?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















When I run xprop I get a class string that has two values, one of them i3 calls an instance, the other a class, for example on chromium-browser the xprop utility will return something like this,



WM_CLASS(STRING) = "chromium-browser", "Chromium-browser"


What is the official guidance on a window and these two fields? For this they're pretty similar. Are they ever different? If so, what should I pick and why? How are GUI-authors supposed to class and instance their names?










share|improve this question




























    1















    When I run xprop I get a class string that has two values, one of them i3 calls an instance, the other a class, for example on chromium-browser the xprop utility will return something like this,



    WM_CLASS(STRING) = "chromium-browser", "Chromium-browser"


    What is the official guidance on a window and these two fields? For this they're pretty similar. Are they ever different? If so, what should I pick and why? How are GUI-authors supposed to class and instance their names?










    share|improve this question


























      1












      1








      1








      When I run xprop I get a class string that has two values, one of them i3 calls an instance, the other a class, for example on chromium-browser the xprop utility will return something like this,



      WM_CLASS(STRING) = "chromium-browser", "Chromium-browser"


      What is the official guidance on a window and these two fields? For this they're pretty similar. Are they ever different? If so, what should I pick and why? How are GUI-authors supposed to class and instance their names?










      share|improve this question
















      When I run xprop I get a class string that has two values, one of them i3 calls an instance, the other a class, for example on chromium-browser the xprop utility will return something like this,



      WM_CLASS(STRING) = "chromium-browser", "Chromium-browser"


      What is the official guidance on a window and these two fields? For this they're pretty similar. Are they ever different? If so, what should I pick and why? How are GUI-authors supposed to class and instance their names?







      x11 window-manager window standard x






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 13 at 0:22







      Evan Carroll

















      asked Jan 12 at 21:43









      Evan CarrollEvan Carroll

      5,499104381




      5,499104381




















          1 Answer
          1






          active

          oldest

          votes


















          1














          The actual behavior is defined by the spec entitled the Inter-Client Communication Conventions Manual (ICCM). Basically the class name is specified by the person who makes the app. The instance name can be specified by the user and should override the class name if present.



          Here is what ICCMv2 for X11r6 says on WM_CLASS,




          4.1.2.5. WM_CLASS Property



          The WM_CLASS property (of type STRING without control characters) contains two consecutive null-terminated strings. These specify the Instance and Class names to be used by both the client and the window manager for looking up resources for the application or as identifying information. This property must be present when the window leaves the Withdrawn state and may be changed only while the window is in the Withdrawn state. Window managers may examine the property only when they start up and when the window leaves the Withdrawn state, but there should be no need for a client to change its state dynamically.



          The two strings, respectively, are:




          • A string that names the particular instance of the application to which the client that owns this window belongs. Resources that are specified by instance name override any resources that are specified by class name. Instance names can be specified by the user in an operating-system specific manner. On POSIX-conformant systems, the following conventions are used:



            • If -name NAME is given on the command line, NAME is used as the instance name.

            • Otherwise, if the environment variable RESOURCE_NAME is set, its value will be used as the instance name.

            • Otherwise, the trailing part of the name used to invoke the program (argv[0] stripped of any directory names) is used as the instance name.


          • A string that names the general class of applications to which the client that owns this window belongs. Resources that are specified by class apply to all applications that have the same class name. Class names are specified by the application writer. Examples of commonly used class names include: "Emacs", "XTerm", "XClock", "XLoad", and so on.

          Note that WM_CLASS strings are null-terminated and, thus, differ from the general conventions that STRING properties are null-separated. This inconsistency is necessary for backwards compatibility.




          (emphasis in bold added by me)






          share|improve this answer
























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494169%2fwm-class-vs-wm-instance%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            The actual behavior is defined by the spec entitled the Inter-Client Communication Conventions Manual (ICCM). Basically the class name is specified by the person who makes the app. The instance name can be specified by the user and should override the class name if present.



            Here is what ICCMv2 for X11r6 says on WM_CLASS,




            4.1.2.5. WM_CLASS Property



            The WM_CLASS property (of type STRING without control characters) contains two consecutive null-terminated strings. These specify the Instance and Class names to be used by both the client and the window manager for looking up resources for the application or as identifying information. This property must be present when the window leaves the Withdrawn state and may be changed only while the window is in the Withdrawn state. Window managers may examine the property only when they start up and when the window leaves the Withdrawn state, but there should be no need for a client to change its state dynamically.



            The two strings, respectively, are:




            • A string that names the particular instance of the application to which the client that owns this window belongs. Resources that are specified by instance name override any resources that are specified by class name. Instance names can be specified by the user in an operating-system specific manner. On POSIX-conformant systems, the following conventions are used:



              • If -name NAME is given on the command line, NAME is used as the instance name.

              • Otherwise, if the environment variable RESOURCE_NAME is set, its value will be used as the instance name.

              • Otherwise, the trailing part of the name used to invoke the program (argv[0] stripped of any directory names) is used as the instance name.


            • A string that names the general class of applications to which the client that owns this window belongs. Resources that are specified by class apply to all applications that have the same class name. Class names are specified by the application writer. Examples of commonly used class names include: "Emacs", "XTerm", "XClock", "XLoad", and so on.

            Note that WM_CLASS strings are null-terminated and, thus, differ from the general conventions that STRING properties are null-separated. This inconsistency is necessary for backwards compatibility.




            (emphasis in bold added by me)






            share|improve this answer





























              1














              The actual behavior is defined by the spec entitled the Inter-Client Communication Conventions Manual (ICCM). Basically the class name is specified by the person who makes the app. The instance name can be specified by the user and should override the class name if present.



              Here is what ICCMv2 for X11r6 says on WM_CLASS,




              4.1.2.5. WM_CLASS Property



              The WM_CLASS property (of type STRING without control characters) contains two consecutive null-terminated strings. These specify the Instance and Class names to be used by both the client and the window manager for looking up resources for the application or as identifying information. This property must be present when the window leaves the Withdrawn state and may be changed only while the window is in the Withdrawn state. Window managers may examine the property only when they start up and when the window leaves the Withdrawn state, but there should be no need for a client to change its state dynamically.



              The two strings, respectively, are:




              • A string that names the particular instance of the application to which the client that owns this window belongs. Resources that are specified by instance name override any resources that are specified by class name. Instance names can be specified by the user in an operating-system specific manner. On POSIX-conformant systems, the following conventions are used:



                • If -name NAME is given on the command line, NAME is used as the instance name.

                • Otherwise, if the environment variable RESOURCE_NAME is set, its value will be used as the instance name.

                • Otherwise, the trailing part of the name used to invoke the program (argv[0] stripped of any directory names) is used as the instance name.


              • A string that names the general class of applications to which the client that owns this window belongs. Resources that are specified by class apply to all applications that have the same class name. Class names are specified by the application writer. Examples of commonly used class names include: "Emacs", "XTerm", "XClock", "XLoad", and so on.

              Note that WM_CLASS strings are null-terminated and, thus, differ from the general conventions that STRING properties are null-separated. This inconsistency is necessary for backwards compatibility.




              (emphasis in bold added by me)






              share|improve this answer



























                1












                1








                1







                The actual behavior is defined by the spec entitled the Inter-Client Communication Conventions Manual (ICCM). Basically the class name is specified by the person who makes the app. The instance name can be specified by the user and should override the class name if present.



                Here is what ICCMv2 for X11r6 says on WM_CLASS,




                4.1.2.5. WM_CLASS Property



                The WM_CLASS property (of type STRING without control characters) contains two consecutive null-terminated strings. These specify the Instance and Class names to be used by both the client and the window manager for looking up resources for the application or as identifying information. This property must be present when the window leaves the Withdrawn state and may be changed only while the window is in the Withdrawn state. Window managers may examine the property only when they start up and when the window leaves the Withdrawn state, but there should be no need for a client to change its state dynamically.



                The two strings, respectively, are:




                • A string that names the particular instance of the application to which the client that owns this window belongs. Resources that are specified by instance name override any resources that are specified by class name. Instance names can be specified by the user in an operating-system specific manner. On POSIX-conformant systems, the following conventions are used:



                  • If -name NAME is given on the command line, NAME is used as the instance name.

                  • Otherwise, if the environment variable RESOURCE_NAME is set, its value will be used as the instance name.

                  • Otherwise, the trailing part of the name used to invoke the program (argv[0] stripped of any directory names) is used as the instance name.


                • A string that names the general class of applications to which the client that owns this window belongs. Resources that are specified by class apply to all applications that have the same class name. Class names are specified by the application writer. Examples of commonly used class names include: "Emacs", "XTerm", "XClock", "XLoad", and so on.

                Note that WM_CLASS strings are null-terminated and, thus, differ from the general conventions that STRING properties are null-separated. This inconsistency is necessary for backwards compatibility.




                (emphasis in bold added by me)






                share|improve this answer















                The actual behavior is defined by the spec entitled the Inter-Client Communication Conventions Manual (ICCM). Basically the class name is specified by the person who makes the app. The instance name can be specified by the user and should override the class name if present.



                Here is what ICCMv2 for X11r6 says on WM_CLASS,




                4.1.2.5. WM_CLASS Property



                The WM_CLASS property (of type STRING without control characters) contains two consecutive null-terminated strings. These specify the Instance and Class names to be used by both the client and the window manager for looking up resources for the application or as identifying information. This property must be present when the window leaves the Withdrawn state and may be changed only while the window is in the Withdrawn state. Window managers may examine the property only when they start up and when the window leaves the Withdrawn state, but there should be no need for a client to change its state dynamically.



                The two strings, respectively, are:




                • A string that names the particular instance of the application to which the client that owns this window belongs. Resources that are specified by instance name override any resources that are specified by class name. Instance names can be specified by the user in an operating-system specific manner. On POSIX-conformant systems, the following conventions are used:



                  • If -name NAME is given on the command line, NAME is used as the instance name.

                  • Otherwise, if the environment variable RESOURCE_NAME is set, its value will be used as the instance name.

                  • Otherwise, the trailing part of the name used to invoke the program (argv[0] stripped of any directory names) is used as the instance name.


                • A string that names the general class of applications to which the client that owns this window belongs. Resources that are specified by class apply to all applications that have the same class name. Class names are specified by the application writer. Examples of commonly used class names include: "Emacs", "XTerm", "XClock", "XLoad", and so on.

                Note that WM_CLASS strings are null-terminated and, thus, differ from the general conventions that STRING properties are null-separated. This inconsistency is necessary for backwards compatibility.




                (emphasis in bold added by me)







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 13 at 7:05

























                answered Jan 12 at 21:49









                Evan CarrollEvan Carroll

                5,499104381




                5,499104381



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494169%2fwm-class-vs-wm-instance%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?