[
  {
    "path": ".gitignore",
    "content": "/build/\n/pkg/\n*~\n.idea/\n.ts-for-gir.js\n.vscode/\njsconfig.json\n@types/"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "Makefile",
    "content": "SHARED_VM = $(HOME)/Projects/.shared/\n\n.PHONY: build_pkg build vm_test install remove clean\n\n\nbuild: clean\n\tglib-compile-schemas src/schemas\n\tmkdir -p build/\n\tcp -r src/* build/\n\trm -f build/prefs.ui~\n\n\nbuild_pkg: build\n\tmkdir -p pkg/\n\tcd build/ && zip -r ../pkg/blur-me@nunchucks.zip .\n\n\nvm_test: build\n\trm -rf $(SHARED_VM)/blur_my_shell/blur-me@nunchucks\n\tmkdir -p $(SHARED_VM)/blur_my_shell/blur-me@nunchucks\n\tcp -r build/* $(SHARED_VM)/blur_my_shell/blur-me@nunchucks/\n\nvm_pkg: build_pkg\n\tcp pkg/blur-me@nunchucks.zip $(SHARED_VM)/blur_my_shell/blur-me@nunchucks.zip\n\ninstall: build\n\trm -rf $(HOME)/.local/share/gnome-shell/extensions/blur-me@nunchucks\n\tmkdir -p $(HOME)/.local/share/gnome-shell/extensions/blur-me@nunchucks\n\tcp -r build/* $(HOME)/.local/share/gnome-shell/extensions/blur-me@nunchucks/\n\n\nremove:\n\trm -rf $(HOME)/.local/share/gnome-shell/extensions/blur-me@nunchucks\n\n\nclean:\n\trm -rf pkg/ build/\n"
  },
  {
    "path": "README.md",
    "content": "# GNOME Shell Extension - Blur Me\n\nA GNOME Shell extension to blur:\n\nApplications | Dash | Overview | Dash | Panel | Onscreen Keyboard | & More!\n\n![blurred-applications](images/blurred-applications.png?raw=true)\n*blurred applications* With [Materia Transparent](https://github.com/ckissane/materia-theme-transparent)\n\n![blurred-top-panel](images/blurred-top-panel.png?raw=true)\n*blurred top panel*\n![blurred-overview](images/blurred-overview.png?raw=true)\n*blurred overview*\n\n[<img src=\"https://github.com/aunetx/files_utils/raw/master/get_it_on_gnome_extensions.png\" height=\"100\">](https://extensions.gnome.org/extension/4236/blur-me/)\n\nA GNOME Shell extension that adds a blur look to different parts of the GNOME Shell, including the top panel, dash and overview.\n\nFunctionalities:\n\n- blur dash with opacity prefs\n- blur panel\n- blur overview\n- blur appfolders\n- blur workspaces separation\n- change lockscreen blur settings\n- change appgrid's folders background blur intensity\n- choose between static blur (generated once) and dynamic blur (generated each frame) for panel blur\n- change performances settings\n\nThis extension is guaranteed to be compatible with the following extensions:\n\n- [Dash to Dock](https://github.com/micheleg/dash-to-dock) (from dash blur switch)\n- [Dash to Panel](https://github.com/home-sweet-gnome/dash-to-panel) (from panel blur switch)\n- [Window List](https://extensions.gnome.org/extension/602/window-list/) (from dedicated switch)\n- [Hide Top Bar](https://github.com/mlutfy/hidetopbar) (from dedicated option)\n\n\n## Screenshots\n\nBlurred Overview:\n![Blurred Overview](https://user-images.githubusercontent.com/38633812/116588850-779beb80-a935-11eb-8f2f-81bcd46fe694.png)\n\nBlurred Top Panel:\n![Blurred Top Panel](https://user-images.githubusercontent.com/38633812/116588885-81bdea00-a935-11eb-9c80-c97716369b7c.png)\n\nPreferences:\n![Preferences](https://user-images.githubusercontent.com/31563930/130880374-4345abd9-2ed0-4f97-95b3-66d9039395e1.png)\n\n## Known bugs\n\n### Note\n\nThis extension can be buggy, as the gnome-shell's blur implementation is quite flawed in some ways.\n\nTo entirely remove artifacts from the top panel, you can use static blur with the appropriate switch, **use static blur**.\n\nMoreover, if you don't use static blur, selecting *no artefacts* in the settings allows the blur to regenerate itself a lot better, at the expense of CPU time (but cannot currently tell the difference, less than 0.5% CPU on my middle-range i5)\n\nSelecting another profile might be enough (especially if you have disabled animations and/or windows borders), feel free to test!\n\n### List of bugs\n\n- artifacts on blurred parts [gnome shell bug](https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2857)\n- some apps may become transparent, a weird issue...\n- cannot create rounded blur (so no rounded dash-to-dock, or panel corners, ...)\n- overview blur is transparent on second monitor when using Wayland, sometimes :(\n- etc (see in *issues*)\n\nIf you find other bugs, please report them!\n\n## Advanced\n\n### Install from source\n\nTo install the latest version (though maybe unstable), use the makefile:\n\n```sh\ngit clone https://github.com/ckissane/blur-me\ncd blur-me\nmake install\n```\n\nAnd restart GNOME Shell if needed.\n\n### Force overview blur update\n\nIn case you have problems with your dynamic timed wallpaper not being updated due to using third-party process to change the wallpaper, you can force the overview blur to be updated with the command:\\\n`gsettings set org.gnome.desktop.background picture-opacity 99 && gsettings set org.gnome.desktop.background picture-opacity 100`\n\n### Versions support\n\nThe current extension supports these GNOME Shell versions:\n\n- 41 -- `master` branch\n- 40 -- `master` branch\n\n## License\n\nThis program is distributed under the terms of the GNU General Public License, version 2 or later.\n"
  },
  {
    "path": "src/appfolders.js",
    "content": "'use strict';\n\nconst { Shell, GLib, Clutter } = imports.gi;\nconst Main = imports.ui.main;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\nconst PaintSignals = Me.imports.paint_signals;\n\nconst transparent = Clutter.Color.from_pixel(0x00000000);\nconst FOLDER_DIALOG_ANIMATION_TIME = 200;\nconst FRAME_UPDATE_PERIOD = 16;\n\nlet original_zoomAndFadeIn = null;\nlet original_zoomAndFadeOut = null;\nlet sigma = 30;\nlet brightness = 0.6;\n\nlet _zoomAndFadeIn = function () {\n    let [sourceX, sourceY] =\n        this._source.get_transformed_position();\n    let [dialogX, dialogY] =\n        this.child.get_transformed_position();\n\n    this.child.set({\n        translation_x: sourceX - dialogX,\n        translation_y: sourceY - dialogY,\n        scale_x: this._source.width / this.child.width,\n        scale_y: this._source.height / this.child.height,\n        opacity: 0,\n    });\n\n    this.set_background_color(transparent);\n\n    let effect = this.get_effect(\"appfolder-blur\");\n\n    effect.sigma = 0;\n    Utils.ease_property(effect, 'sigma', 0, sigma, FOLDER_DIALOG_ANIMATION_TIME, FRAME_UPDATE_PERIOD);\n\n    effect.brightness = 1.0;\n    Utils.ease_property(effect, 'brightness', 1.0, brightness, FOLDER_DIALOG_ANIMATION_TIME, FRAME_UPDATE_PERIOD);\n\n    this.child.ease({\n        translation_x: 0,\n        translation_y: 0,\n        scale_x: 1,\n        scale_y: 1,\n        opacity: 255,\n        duration: FOLDER_DIALOG_ANIMATION_TIME,\n        mode: Clutter.AnimationMode.EASE_OUT_QUAD,\n    });\n\n    this._needsZoomAndFade = false;\n\n    if (this._sourceMappedId === 0) {\n        this._sourceMappedId = this._source.connect(\n            'notify::mapped', this._zoomAndFadeOut.bind(this));\n    }\n}\n\nlet _zoomAndFadeOut = function () {\n    if (!this._isOpen)\n        return;\n\n    if (!this._source.mapped) {\n        this.hide();\n        return;\n    }\n\n    let [sourceX, sourceY] =\n        this._source.get_transformed_position();\n    let [dialogX, dialogY] =\n        this.child.get_transformed_position();\n\n    this.set_background_color(transparent);\n\n    let effect = this.get_effect(\"appfolder-blur\");\n\n    Utils.ease_property(effect, 'sigma', effect.sigma, 0, FOLDER_DIALOG_ANIMATION_TIME, FRAME_UPDATE_PERIOD);\n\n    Utils.ease_property(effect, 'brightness', effect.brightness, 1.0, FOLDER_DIALOG_ANIMATION_TIME, FRAME_UPDATE_PERIOD);\n\n    this.child.ease({\n        translation_x: sourceX - dialogX,\n        translation_y: sourceY - dialogY,\n        scale_x: this._source.width / this.child.width,\n        scale_y: this._source.height / this.child.height,\n        opacity: 0,\n        duration: FOLDER_DIALOG_ANIMATION_TIME,\n        mode: Clutter.AnimationMode.EASE_OUT_QUAD,\n        onComplete: () => {\n            this.child.set({\n                translation_x: 0,\n                translation_y: 0,\n                scale_x: 1,\n                scale_y: 1,\n                opacity: 255,\n            });\n            this.hide();\n\n            this._popdownCallbacks.forEach(func => func());\n            this._popdownCallbacks = [];\n        },\n    });\n\n    this._needsZoomAndFade = false;\n}\n\n\nvar AppFoldersBlur = class AppFoldersBlur {\n    constructor(connections, prefs) {\n        this.connections = connections;\n        this.paint_signals = new PaintSignals.PaintSignals(connections);\n        this.prefs = prefs;\n    }\n\n    enable() {\n        this._log(\"blurring appfolders\");\n\n        if (Main.overview._overview.controls._appDisplay._folderIcons.length > 0) {\n            this.blur_appfolders();\n        }\n        this.connections.connect(Main.overview._overview.controls._appDisplay, 'view-loaded', () => {\n            this.blur_appfolders();\n        })\n    }\n\n    blur_appfolders() {\n        Main.overview._overview.controls._appDisplay._folderIcons.forEach(icon => {\n            icon._ensureFolderDialog();\n\n            if (original_zoomAndFadeIn == null) {\n                original_zoomAndFadeIn = icon._dialog._zoomAndFadeIn;\n            }\n            if (original_zoomAndFadeOut == null) {\n                original_zoomAndFadeOut = icon._dialog._zoomAndFadeOut;\n            }\n\n            let effect = new Shell.BlurEffect({\n                name: \"appfolder-blur\",\n                sigma: sigma,\n                brightness: brightness,\n                mode: 1\n            });\n            icon._dialog.remove_effect_by_name(\"appfolder-blur\");\n            icon._dialog.add_effect(effect);\n\n            // HACK\n            // ! DIRTY PART: hack because `Shell.BlurEffect` does not repaint when shadows are under it\n            // ! this does not entirely fix this bug (shadows caused by windows still cause artefacts)\n            // ! but it prevents the shadows of the panel buttons to cause artefacts on the panel itself\n            // ! note: issue opened at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2857\n\n            if (this.prefs.HACKS_LEVEL.get() == 1) {\n                this._log(\"appfolders hack level 1\");\n                this.paint_signals.disconnect_all();\n\n                Utils.setTimeout(() => {\n                    this.paint_signals.connect(Main.overview._overview, effect);\n                    this.paint_signals.connect(icon._dialog, effect);\n                }, 100);\n            } else if (this.prefs.HACKS_LEVEL.get() == 2) {\n                this._log(\"appfolders hack level 2\");\n                this.paint_signals.disconnect_all();\n\n                Utils.setTimeout(() => {\n                    this.paint_signals.connect(Main.overview._overview, effect);\n                    this.paint_signals.connect(icon._dialog, effect);\n                }, 100);\n            } else {\n                this.paint_signals.disconnect_all();\n            }\n\n            // ! END OF DIRTY PART\n\n            icon._dialog._viewBox.set_style_class_name('app-folder-dialog transparent-app-folder-dialogs-' + 100 * this.prefs.APPFOLDER_DIALOG_OPACITY.get());\n\n            icon._dialog._zoomAndFadeIn = _zoomAndFadeIn;\n            icon._dialog._zoomAndFadeOut = _zoomAndFadeOut;\n        });\n    }\n\n    set_sigma(s) {\n        sigma = s;\n        if (this.prefs.BLUR_APPFOLDERS.get())\n            this.blur_appfolders();\n    }\n\n    set_brightness(b) {\n        brightness = b;\n        if (this.prefs.BLUR_APPFOLDERS.get())\n            this.blur_appfolders();\n    }\n\n    disable() {\n        this._log(\"removing blur from appfolders\");\n\n        if (original_zoomAndFadeIn != null) {\n            Main.overview._overview.controls._appDisplay._folderIcons.forEach(icon => {\n                if (icon._dialog)\n                    icon._dialog._zoomAndFadeIn = original_zoomAndFadeIn;\n            });\n        }\n        if (original_zoomAndFadeOut != null) {\n            Main.overview._overview.controls._appDisplay._folderIcons.forEach(icon => {\n                if (icon._dialog)\n                    icon._dialog._zoomAndFadeOut = original_zoomAndFadeOut;\n            });\n        }\n        Main.overview._overview.controls._appDisplay._folderIcons.forEach(icon => {\n            if (icon._dialog) {\n                icon._dialog.remove_effect_by_name(\"appfolder-blur\")\n                icon._dialog._viewBox.remove_style_class_name('transparent-app-folder-dialogs-' + 100 * this.prefs.APPFOLDER_DIALOG_OPACITY.get());\n            }\n        });\n\n        this.connections.disconnect_all();\n    }\n\n    _log(str) {\n        if (this.prefs.DEBUG.get())\n            log(`[Blur my Shell] ${str}`)\n    }\n}"
  },
  {
    "path": "src/applications.js",
    "content": "\"use strict\";\n\nconst { St, Shell, Meta, Gio, GLib } = imports.gi;\nconst Main = imports.ui.main;\nconst Clutter = imports.gi.Clutter;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\nconst PanelIndicator = Me.imports.panel_indicator;\nlet prefs = new Settings.Prefs();\n\nconst default_sigma = 30;\nconst default_brightness = 0.6;\n\nlet sigma = 30;\n\nvar ApplicationsBlur = class ApplicationsBlur {\n  constructor(connections) {\n    this.connections = connections;\n    this.effect = new Shell.BlurEffect({\n      brightness: default_brightness,\n      sigma: default_sigma,\n      mode: Shell.BlurMode.BACKGROUND,\n    });\n    this.windowActorBlurMap = new Map();\n    this.pid = 0;\n    this.override_map = {};\n    \n  }\n  create_blur_actor(pid) {\n    let wab = this.windowActorBlurMap.get(pid);\n    let meta_window = wab.window;\n    let window_actor = wab.actor;\n\n    let blurEffect = new Shell.BlurEffect({\n      brightness: this.effect.brightness,\n      sigma: this.effect.sigma,\n      mode: this.effect.mode,\n    });\n    const frame = meta_window.get_frame_rect();\n    const buffer = meta_window.get_buffer_rect();\n    const offsetX = frame.x - buffer.x;\n    const offsetY = frame.y - buffer.y;\n    const offsetWidth = buffer.width - frame.width;\n    const offsetHeight = buffer.height - frame.height;\n\n    let constraintPosX = new Clutter.BindConstraint({\n      source: window_actor,\n      coordinate: Clutter.BindCoordinate.X,\n      offset: offsetX,\n    });\n    let constraintPosY = new Clutter.BindConstraint({\n      source: window_actor,\n      coordinate: Clutter.BindCoordinate.Y,\n      offset: offsetY,\n    });\n\n    let constraintSizeX = new Clutter.BindConstraint({\n      source: window_actor,\n      coordinate: Clutter.BindCoordinate.WIDTH,\n      offset: -offsetWidth,\n    });\n    let constraintSizeY = new Clutter.BindConstraint({\n      source: window_actor,\n      coordinate: Clutter.BindCoordinate.HEIGHT,\n      offset: -offsetHeight,\n    });\n\n    let blurActor = new Clutter.Actor();\n    blurActor.add_constraint(constraintPosX);\n    blurActor.add_constraint(constraintPosY);\n    blurActor.add_constraint(constraintSizeX);\n    blurActor.add_constraint(constraintSizeY);\n\n    blurActor.add_effect_with_name(\"blur-effect\", blurEffect);\n    wab.blurActor = blurActor;\n    if (wab.actor.visible && !wab.excluded) {\n      blurActor.show();\n    } else {\n      blurActor.hide();\n    }\n    meta_window.connect(\"size-changed\", (...args) => {\n      const frame = meta_window.get_frame_rect();\n      const buffer = meta_window.get_buffer_rect();\n      const offsetX = frame.x - buffer.x;\n      const offsetY = frame.y - buffer.y;\n      const offsetWidth = buffer.width - frame.width;\n      const offsetHeight = buffer.height - frame.height;\n\n      blurActor.remove_constraint(constraintPosX);\n      constraintPosX = new Clutter.BindConstraint({\n        source: window_actor,\n        coordinate: Clutter.BindCoordinate.X,\n        offset: offsetX,\n      });\n      blurActor.remove_constraint(constraintPosY);\n      constraintPosY = new Clutter.BindConstraint({\n        source: window_actor,\n        coordinate: Clutter.BindCoordinate.Y,\n        offset: offsetY,\n      });\n\n      blurActor.remove_constraint(constraintSizeX);\n      constraintSizeX = new Clutter.BindConstraint({\n        source: window_actor,\n        coordinate: Clutter.BindCoordinate.WIDTH,\n        offset: -offsetWidth,\n      });\n      blurActor.remove_constraint(constraintSizeY);\n      constraintSizeY = new Clutter.BindConstraint({\n        source: window_actor,\n        coordinate: Clutter.BindCoordinate.HEIGHT,\n        offset: -offsetHeight,\n      });\n      blurActor.add_constraint(constraintPosX);\n      blurActor.add_constraint(constraintPosY);\n      blurActor.add_constraint(constraintSizeX);\n      blurActor.add_constraint(constraintSizeY);\n    });\n    return blurActor;\n  }\n\n  update_blur(pid) {\n    if (this.windowActorBlurMap.has(pid)) {\n      let wab = this.windowActorBlurMap.get(pid);\n      wab.excluded = this.override_map[Utils.get_process_name_from_window(wab.window)] === false;\n      if (wab.blurActor) {\n        this.update_blur_actor(pid);\n      } else {\n        this.init_blur_actor(pid);\n      }\n    }\n  }\n\n  set_blur_behind(blurActor, actor) {\n    if (actor.get_parent() === blurActor.get_parent()) {\n      global.window_group.set_child_below_sibling(blurActor, actor);\n    }\n  }\n\n  remove_blur(pid) {\n    if (this.windowActorBlurMap.has(pid)) {\n      let wab = this.windowActorBlurMap.get(pid);\n      delete wab.window[\"blur_provider_pid\"];\n      global.window_group.remove_actor(wab.blurActor);\n      this.windowActorBlurMap.delete(pid);\n    }\n  }\n\n  update_blur_actor(pid) {\n    if (this.windowActorBlurMap.has(pid)) {\n      let wab = this.windowActorBlurMap.get(pid);\n      let blur_actor = wab.blurActor;\n      if (blur_actor) {\n        let blurEffect = new Shell.BlurEffect({\n          brightness: this.effect.brightness,\n          sigma: this.effect.sigma,\n          mode: this.effect.mode,\n        });\n        blur_actor.remove_effect_by_name(\"blur-effect\");\n        blur_actor.add_effect_with_name(\"blur-effect\", blurEffect);\n        if (wab.actor.visible && !wab.excluded) {\n          blur_actor.show();\n        } else {\n          blur_actor.hide();\n        }\n      }\n    }\n  }\n\n  init_blur_actor(pid) {\n    let wab = this.windowActorBlurMap.get(pid);\n    if (!wab.blurActor) {\n      let blurActor = this.create_blur_actor(pid);\n      wab.blurActor = blurActor;\n      global.window_group.insert_child_below(blurActor, wab.actor);\n      blurActor[\"blur_provider_pid\"] = pid;\n      this.connections.connect(wab.actor, \"notify::visible\", (window_actor) => {\n        let pid = window_actor.blur_provider_pid;\n        if (this.windowActorBlurMap.has(pid)) {\n          let blurActor = this.windowActorBlurMap.get(pid).blurActor;\n          if (blurActor) {\n            if (\n              window_actor.visible &&\n              !this.windowActorBlurMap.get(pid).excluded\n            ) {\n              blurActor.show();\n            } else {\n              blurActor.hide();\n            }\n          }\n        }\n      });\n    }\n  }\n\n  track_new(actor, window) {\n    let pid = window[\"blur_provider_pid\"] || this.pid++;\n    if (!this.windowActorBlurMap.has(pid)) {\n      actor[\"blur_provider_pid\"] = pid;\n      window[\"blur_provider_pid\"] = pid;\n      let wab = { window: window, actor: actor, blurActor: null };\n      this.windowActorBlurMap.set(pid, wab);\n      this.connections.connect(actor, \"destroy\", (window_actor) => {\n        this.actor_destroyed(window_actor);\n      });\n      this.connections.connect(window, \"unmanaged\", (meta_window) =>\n        this.window_unmanaged(meta_window)\n      );\n      this.update_blur(pid);\n    }\n  }\n\n  cleanup_things() {\n    this.windowActorBlurMap.forEach((value, pid) => {\n      this.destroy_wab(pid);\n    });\n  }\n\n  focus_changed() {\n    if (this.windowActorBlurMap.size > 0) {\n      Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => this.fix_blur());\n    }\n  }\n\n  blur_setting_changed() {\n    this.windowActorBlurMap.forEach((wab, pid) => {\n      this.update_blur(pid);\n    });\n  }\n\n  fix_blur() {\n    this.windowActorBlurMap.forEach((wab) => {\n      this.set_blur_behind(wab.blurActor, wab.actor);\n    });\n  }\n\n  destroy_wab(pid) {\n    this.remove_blur(pid);\n    this.windowActorBlurMap.delete(pid);\n  }\n  window_unmanaged(meta_window) {\n    this._log(\"window_unmanaged\");\n    try {\n      let pid = meta_window.blur_provider_pid;\n      this.destroy_wab(pid);\n    } catch (e) {}\n  }\n\n  actor_destroyed(window_actor) {\n    let pid = window_actor.blur_provider_pid;\n    try {\n      let pid = meta_window.blur_provider_pid;\n      this.destroy_wab(pid);\n    } catch (e) {}\n  }\n\n  window_created(meta_display, meta_window) {\n    log(\"window created\");\n    if (!meta_window) {\n      this._log(\"no meta window\");\n      return;\n    }\n    let window_actor = meta_window.get_compositor_private();\n    this.track_new(window_actor, meta_window);\n  }\n  enable() {\n    this._log(\"blurring applications\");\n    this.connections.connect(global.display, \"notify::focus-window\", () =>\n      this.focus_changed()\n    );\n    this.connections.connect(\n      global.display,\n      \"window-created\",\n      (meta_display, meta_window) => {\n        this.window_created(meta_display, meta_window);\n      }\n    );\n    for (let wks = 0; wks < global.workspace_manager.n_workspaces; ++wks) {\n      let metaWorkspace = global.workspace_manager.get_workspace_by_index(wks);\n      let windows = metaWorkspace.list_windows();\n      windows.forEach((v) => {\n        this.window_created(undefined, v);\n      });\n    }\n    this.handle=Utils.setInterval(() => this.fix_blur(), 16);\n    // try {\n    //   PanelIndicator.PanelIndicator.enable();\n    // } catch (e) {}\n  }\n\n  get monitor() {\n    return Main.layoutManager.primaryMonitor;\n  }\n\n  set_sigma(s) {\n    this.effect.sigma = s;\n    this.blur_setting_changed();\n  }\n\n  set_brightness(b) {\n    this.effect.brightness = b;\n    this.blur_setting_changed();\n  }\n  set_overrides(overrides) {\n    this.override_map = overrides;\n    this.blur_setting_changed();\n  }\n\n  disable() {\n    this._log(\"removing blur from applications\");\n\n    try {\n      this.cleanup_things();\n    } catch (e) {}\n    Utils.clearInterval(this.handle);\n    this.connections.disconnect_all();\n    // try {\n    //   PanelIndicator.PanelIndicator.disable();\n    // } catch (e) {}\n  }\n\n  show() {}\n\n  hide() {}\n\n  _log(str) {\n    log(`[Blur Me] ${str}`);\n  }\n};\n"
  },
  {
    "path": "src/connections.js",
    "content": "'use strict';\n\nconst GObject = imports.gi.GObject;\n\n\nvar Connections = class Connections {\n    constructor() {\n        this.buffer = [];\n    }\n\n    process_connection(actor, id) {\n        let infos = {\n            actor: actor,\n            id: id\n        };\n\n        if (actor.connect && (!(actor instanceof GObject.Object) || GObject.signal_lookup('destroy', actor))) {\n            let destroy_id = actor.connect('destroy', () => {\n                actor.disconnect(id);\n                actor.disconnect(destroy_id);\n\n                let index = this.buffer.indexOf(infos);\n                if (index >= 0) {\n                    this.buffer.splice(index, 1)\n                }\n            })\n        }\n\n        this.buffer.push(infos)\n    }\n\n    connect(actor, signal, handler) {\n        let id = actor.connect(signal, handler);\n        this.process_connection(actor, id);\n    }\n\n    connect_after(actor, signal, handler) {\n        let id = actor.connect_after(signal, handler);\n\n        this.process_connection(actor, id);\n    }\n\n    disconnect_all_for(actor) {\n        let actor_connections = []\n\n        this.buffer.forEach((infos) => {\n            if (infos.actor == actor) {\n                actor_connections.push(infos)\n            }\n        });\n\n        actor_connections.forEach((connection) => {\n            // disconnect\n            try {\n                connection.actor.disconnect(connection.id)\n            } catch (e) {\n                this._log(`error removing connection: ${e}; continuing`)\n            }\n\n            // remove from buffer\n            let index = this.buffer.indexOf(connection);\n            this.buffer.splice(index, 1);\n        })\n    }\n\n    disconnect_all() {\n        this.buffer.forEach((connection) => {\n            try {\n                connection.actor.disconnect(connection.id)\n            } catch (e) {\n                this._log(`error removing connection: ${e}; continuing`)\n            }\n        })\n        this.buffer = [];\n    }\n\n    // no need to check if DEBUG here, the log function is only used on error\n    _log(str) {\n        log(`[Blur Me] ${str}`)\n    }\n}"
  },
  {
    "path": "src/dash.js",
    "content": "'use strict';\n\nconst { St, Shell, Meta } = imports.gi;\nconst Main = imports.ui.main;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\n\nvar DashBlur = class DashBlur {\n    constructor(connections, prefs) {\n        this.connections = connections;\n        this.prefs = prefs;\n    }\n\n    enable() {\n        this._log('blurring dash');\n        this.update();\n    }\n\n    update() {\n        if (Main.overview.dash.constructor.name == 'Dash') {\n            Main.overview.dash.get_child_at_index(0).style =\n                'background-color:rgba(0,0,0,' +\n                this.prefs.DASH_OPACITY.get() +\n                ')';\n        }\n    }\n\n    disable() {\n        this._log('removing blur from dash');\n\n        if (Main.overview.dash.constructor.name == 'Dash') {\n            if (Main.screenShield && !Main.screenShield.locked) {\n                try {\n                    Main.overview.dash.get_child_at_index(0).style = null;\n                } catch (e) {\n                    this._log(e);\n                }\n            }\n        }\n\n        this.connections.disconnect_all();\n    }\n\n    _log(str) {\n        if (this.prefs.DEBUG.get()) log(`[Blur Me] ${str}`);\n    }\n};\n"
  },
  {
    "path": "src/dash_to_dock.js",
    "content": "'use strict';\n\nconst { St, Shell, GLib } = imports.gi;\nconst Main = imports.ui.main;\nconst Signals = imports.signals;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\nconst PaintSignals = Me.imports.paint_signals;\n\n// This type of object is created for every dash found, and talks to the main DashBlur thanks\n// to signals. This allows to dynamically track the created dashes for each screen.\nclass DashInfos {\n    constructor(dash_blur, dash, dash_box, background_parent, effect, prefs) {\n        // the parent DashBlur object, to communicate\n        this.dash_blur = dash_blur;\n        // the blurred dash\n        this.dash = dash;\n        // the actually blurred box\n        this.dash_box = dash_box;\n        this.background_parent = background_parent;\n        this.effect = effect;\n        this.prefs = prefs;\n\n        dash_blur.connections.connect(dash_blur, 'remove-dashes', () => {\n            this._log(\"removing blur from dash\");\n            this.dash.get_parent().remove_child(this.background_parent);\n            this.dash.remove_style_class_name('blurred-dash');\n        });\n\n        dash_blur.connections.connect(dash_blur, 'update-sigma', () => {\n            this.effect.sigma = this.dash_blur.sigma;\n        });\n\n        dash_blur.connections.connect(dash_blur, 'update-brightness', () => {\n            this.effect.brightness = this.dash_blur.brightness;\n        });\n\n        dash_blur.connections.connect(dash_blur, 'show', () => {\n            this.effect.sigma = this.dash_blur.sigma;\n        });\n\n        dash_blur.connections.connect(dash_blur, 'hide', () => {\n            this.effect.sigma = 0;\n        });\n    }\n\n    _log(str) {\n        if (this.prefs.DEBUG.get())\n            log(`[Blur my Shell] ${str}`)\n    }\n}\n\nvar DashBlur = class DashBlur {\n    constructor(connections, prefs) {\n        this.dashes = [];\n        this.connections = connections;\n        this.prefs = prefs;\n        this.paint_signals = new PaintSignals.PaintSignals(connections);\n        this.sigma = prefs.SIGMA.get();\n        this.brightness = prefs.BRIGHTNESS.get();\n    }\n\n    enable() {\n        this.connections.connect(Main.uiGroup, 'actor-added', (_, actor) => {\n            if ((actor.get_name() == \"dashtodockContainer\") && (actor.constructor.name == 'DashToDock'))\n                this.try_blur(actor);\n        });\n\n        this.blur_existing_dashes();\n    }\n\n    // Finds all existing dashes on every monitor, and call `try_blur` on them\n    // We cannot only blur `Main.overview.dash`, as there could be multiple screens\n    blur_existing_dashes() {\n        this._log(\"searching for dash\");\n        // blur every dash found\n        Main.uiGroup.get_children().filter((child) => {\n            // filter by name\n            return (child.get_name() == \"dashtodockContainer\") && (child.constructor.name == 'DashToDock')\n        }).forEach(this.try_blur.bind(this));\n    }\n\n    // Tries to blur the dash contained in the given actor\n    try_blur(dash_container) {\n        let dash_box = dash_container._slider.get_child();\n        // verify that we did not already blur that dash\n        if (!dash_box.get_children().some((c) => {\n            return c.get_name() == \"dash-blurred-background-parent\"\n        })) {\n            // finally blur the dash\n            this._log(\"dash to dock found, blurring it\");\n            let dash = dash_box.get_children().find(c => { return c.get_name() == 'dash' })\n            this.dashes.push(this.blur_dash_from(dash, dash_container));\n        }\n    }\n\n    // Blurs the dash and returns a `DashInfos` containing its informations\n    blur_dash_from(dash, dash_container) {\n        // the effect to be applied\n        let effect = new Shell.BlurEffect({\n            brightness: this.brightness,\n            sigma: this.sigma,\n            mode: 1\n        });\n\n        // dash background parent, not visible\n        let background_parent = new St.Widget({\n            name: 'dash-blurred-background-parent',\n            style_class: 'dash-blurred-background-parent',\n            width: 0,\n            height: 0\n        });\n\n        // dash background widget\n        let background = new St.Widget({\n            name: 'dash-blurred-background',\n            style_class: 'dash-blurred-background',\n            x: 0,\n            y: dash_container._slider.y,\n            width: dash.width,\n            height: dash.height,\n        });\n\n        // updates size and position on change\n        this.connections.connect(dash_container._slider, 'notify::y', _ => {\n            background.y = dash_container._slider.y;\n        });\n        this.connections.connect(dash, 'notify::width', _ => {\n            background.width = dash.width;\n        });\n        this.connections.connect(dash, 'notify::height', _ => {\n            background.height = dash.height;\n        });\n\n\n        // HACK\n        {\n            // ! DIRTY PART: hack because `Shell.BlurEffect` does not repaint when shadows are under it\n            // ! this does not entirely fix this bug (shadows caused by windows still cause artefacts)\n            // ! but it prevents the shadows of the dash buttons to cause artefacts on the dash itself\n            // ! note: issue opened at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2857\n\n            if (this.prefs.HACKS_LEVEL.get() == 1) {\n                this._log(\"dash hack level 1\");\n                this.paint_signals.disconnect_all();\n\n                let rp = () => {\n                    effect.queue_repaint()\n                };\n\n                dash._box.get_children().forEach((icon) => {\n                    try {\n                        let zone = icon.get_child_at_index(0);\n                        this.connections.connect(zone, 'enter-event', rp);\n                        this.connections.connect(zone, 'leave-event', rp);\n                        this.connections.connect(zone, 'button-press-event', rp);\n                    } catch (e) {\n                        this._log(`${e}, continuing`);\n                    }\n                })\n\n                this.connections.connect(dash._box, 'actor-added', (_, actor) => {\n                    try {\n                        let zone = actor.get_child_at_index(0);\n                        this.connections.connect(zone, 'enter-event', rp);\n                        this.connections.connect(zone, 'leave-event', rp);\n                        this.connections.connect(zone, 'button-press-event', rp);\n                    } catch (e) {\n                        this._log(`${e}, continuing`);\n                    }\n                })\n\n                this.connections.connect(dash._showAppsIcon, 'enter-event', rp);\n                this.connections.connect(dash._showAppsIcon, 'leave-event', rp);\n                this.connections.connect(dash._showAppsIcon, 'button-press-event', rp);\n\n                this.connections.connect(dash, 'leave-event', rp);\n            } else if (this.prefs.HACKS_LEVEL.get() == 2) {\n                this._log(\"dash hack level 2\");\n\n                this.paint_signals.connect(dash, this.effect);\n            } else {\n                this.paint_signals.disconnect_all();\n            }\n\n            // ! END OF DIRTY PART\n        }\n\n        // add the widget to the dash\n        background.add_effect(effect);\n        background_parent.add_child(background);\n        dash.get_parent().insert_child_at_index(background_parent, 0);\n\n        // remove background color\n        dash.set_style_class_name('blurred-dash');\n\n        // returns infos\n        return new DashInfos(this, dash, dash._background, background_parent, effect, this.prefs);\n    }\n\n    set_sigma(sigma) {\n        this.sigma = sigma;\n        this.emit('update-sigma', true);\n    }\n\n    set_brightness(brightness) {\n        this.brightness = brightness;\n        this.emit('update-brightness', true);\n    }\n\n    disable() {\n        this._log(\"removing blur from dashes\");\n\n        this.emit('remove-dashes', true);\n\n        this.dashes = [];\n        this.connections.disconnect_all();\n    }\n\n    show() {\n        this.emit('show', true);\n    }\n    hide() {\n        this.emit('hide', true);\n    }\n\n    _log(str) {\n        if (this.prefs.DEBUG.get())\n            log(`[Blur my Shell] ${str}`)\n    }\n}\n\nSignals.addSignalMethods(DashBlur.prototype);"
  },
  {
    "path": "src/extension.js",
    "content": "\"use strict\";\n\nconst { St, Shell } = imports.gi;\nconst Main = imports.ui.main;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\n\nconst Settings = Me.imports.settings;\nconst Connections = Me.imports.connections;\n\nconst Panel = Me.imports.panel;\nconst Dash = Me.imports.dash;\nconst Overview = Me.imports.overview;\nconst DashToDock = Me.imports.dash_to_dock;\nconst Lockscreen = Me.imports.lockscreen;\nconst Applications = Me.imports.applications;\nconst PanelIndicator = Me.imports.panel_indicator;\nconst Other = Me.imports.other;\nconst AppFolders = Me.imports.appfolders;\nconst WindowList = Me.imports.window_list;\n\nclass Extension {\n  constructor() {}\n\n  enable() {\n    this._prefs = new Settings.Prefs();\n\n    this._log(\"enabling extension...\");\n    this._connections = [];\n\n    this._panel_blur = new Panel.PanelBlur(\n      new Connections.Connections(),\n      this._prefs\n    );\n    this._dash_blur = new Dash.DashBlur(\n      new Connections.Connections(),\n      this._prefs\n    );\n    this._dash_to_dock_blur = new DashToDock.DashBlur(\n      new Connections.Connections(),\n      this._prefs\n    );\n    this._overview_blur = new Overview.OverviewBlur(\n      new Connections.Connections(),\n      this._prefs\n    );\n    this._lockscreen_blur = new Lockscreen.LockscreenBlur(\n      new Connections.Connections(),\n      this._prefs\n    );\n    this._applications_blur = new Applications.ApplicationsBlur(\n      new Connections.Connections()\n    );\n    this._other_blur = new Other.OtherBlur(new Connections.Connections());\n    this._panel_indicator = new PanelIndicator.PanelIndicator(\n      new Connections.Connections()\n    );\n    this._appfolders_blur = new AppFolders.AppFoldersBlur(\n      new Connections.Connections(),\n      this._prefs\n    );\n    this._window_list_blur = new WindowList.WindowListBlur(\n      new Connections.Connections(),\n      this._prefs\n    );\n\n    this._connections.push(\n      this._panel_blur.connections,\n      this._dash_blur.connections,\n      this._dash_to_dock_blur.connections,\n      this._overview_blur.connections,\n      this._lockscreen_blur.connections,\n      this._appfolders_blur.connections,\n      this._window_list_blur.connections,\n      this._applications_blur.connections,\n      this._other_blur.connections,\n      this._panel_indicator.connections\n    );\n\n    this._connect_to_settings();\n\n    if (this._prefs.BLUR_PANEL.get()) {\n      this._panel_blur.enable();\n    }\n    if (this._prefs.BLUR_DASH.get()) {\n      this._dash_blur.enable();\n      this._dash_to_dock_blur.enable();\n    }\n    if (this._prefs.BLUR_OVERVIEW.get()) {\n      this._overview_blur.enable();\n    }\n    if (this._prefs.BLUR_LOCKSCREEN.get()) {\n      this._lockscreen_blur.enable();\n    }\n    if (this._prefs.BLUR_APPLICATIONS.get()) {\n      this._applications_blur.enable();\n    }\n    if (this._prefs.BLUR_OTHER.get()) {\n      this._other_blur.enable();\n    }\n    if (this._prefs.TOGGLE_APP_BLUR.get()) {\n      this._panel_indicator.enable();\n    }\n\n    if (this._prefs.BLUR_APPFOLDERS.get()) {\n      this._appfolders_blur.enable();\n    }\n    if (this._prefs.BLUR_WINDOW_LIST.get()) {\n      this._window_list_blur.enable();\n    }\n\n    this._update_sigma();\n    this._update_brightness();\n    this._applications_blur.set_overrides(\n      this._prefs.WINDOW_CLASS_OVERRIDES.get()\n    );\n    this._log(\"extension enabled.\");\n  }\n\n  disable() {\n    this._log(\"disabling extension...\");\n\n    this._panel_blur.disable();\n    this._dash_blur.disable();\n    this._dash_to_dock_blur.disable();\n    this._overview_blur.disable();\n    this._lockscreen_blur.disable();\n    this._applications_blur.disable();\n    this._other_blur.disable();\n    this._panel_indicator.disable();\n\n    this._appfolders_blur.disable();\n    this._window_list_blur.disable();\n\n    this._panel_blur = null;\n    this._dash_blur = null;\n    this._dash_to_dock_blur = null;\n    this._overview_blur = null;\n    this._lockscreen_blur = null;\n    this._applications_blur = null;\n    this._other_blur = null;\n    this._panel_indicator = null;\n    this._appfolders_blur = null;\n    this._window_list_blur = null;\n\n    this._disconnect_settings();\n\n    // in theory, this shouldn't be needed if we switch to making modules responsible for disconnecting their own\n    // signals. For now, I will leave this small bit of code in. Calling disable on all modules has already\n    // done the same thing\n    this._connections.forEach((connections) => {\n      connections.disconnect_all();\n    });\n    this._connections = [];\n    this._log(\"extension disabled.\");\n\n    this._prefs = null;\n  }\n\n  _connect_to_settings() {\n    this._prefs.SIGMA.changed(() => {\n      this._update_sigma();\n    });\n    this._prefs.BRIGHTNESS.changed(() => {\n      this._update_brightness();\n    });\n\n    this._prefs.BLUR_DASH.changed(() => {\n      if (this._prefs.BLUR_DASH.get()) {\n        this._dash_blur.enable();\n        this._dash_to_dock_blur.enable();\n      } else {\n        this._dash_blur.disable();\n        this._dash_to_dock_blur.disable();\n      }\n    });\n    this._prefs.BLUR_PANEL.changed(() => {\n      if (this._prefs.BLUR_PANEL.get()) {\n        this._panel_blur.enable();\n      } else {\n        this._panel_blur.disable();\n      }\n    });\n    this._prefs.BLUR_OVERVIEW.changed(() => {\n      if (this._prefs.BLUR_OVERVIEW.get()) {\n        this._overview_blur.enable();\n      } else {\n        this._overview_blur.disable();\n      }\n    });\n    this._prefs.BLUR_LOCKSCREEN.changed(() => {\n      if (this._prefs.BLUR_LOCKSCREEN.get()) {\n        this._lockscreen_blur.enable();\n      } else {\n        this._lockscreen_blur.disable();\n      }\n    });\n    this._prefs.BLUR_APPLICATIONS.changed(() => {\n      if (this._prefs.BLUR_APPLICATIONS.get()) {\n        this._applications_blur.enable();\n        this._panel_indicator.enable();\n      } else {\n        this._applications_blur.disable();\n        this._panel_indicator.disable();\n      }\n    });\n    this._prefs.WINDOW_CLASS_OVERRIDES.changed(() => {\n      this._applications_blur.set_overrides(\n        this._prefs.WINDOW_CLASS_OVERRIDES.get()\n      );\n    });\n    this._prefs.BLUR_OTHER.changed(() => {\n      if (this._prefs.BLUR_OTHER.get()) {\n        this._other_blur.enable();\n      } else {\n        this._other_blur.disable();\n      }\n    });\n    this._prefs.TOGGLE_APP_BLUR.changed(() => {\n      if (this._prefs.TOGGLE_APP_BLUR.get()) {\n        this._panel_indicator.enable();\n      } else {\n        this._panel_indicator.disable();\n      }\n    });\n    this._prefs.BLUR_APPFOLDERS.changed(() => {\n      if (this._prefs.BLUR_APPFOLDERS.get()) {\n        this._appfolders_blur.enable();\n      } else {\n        this._appfolders_blur.disable();\n      }\n    });\n    this._prefs.BLUR_WINDOW_LIST.changed(() => {\n      if (this._prefs.BLUR_WINDOW_LIST.get()) {\n        this._window_list_blur.enable();\n      } else {\n        this._window_list_blur.disable();\n      }\n    });\n    this._prefs.DASH_OPACITY.changed(() => {\n      this._dash_blur.update();\n    });\n    this._prefs.APPFOLDER_DIALOG_OPACITY.changed(() => {\n      this._appfolders_blur.blur_appfolders();\n    });\n    this._prefs.STATIC_BLUR.changed(() => {\n      this._panel_blur.change_blur_type();\n    });\n    this._prefs.HIDETOPBAR.changed(() => {\n      this._panel_blur.connect_to_overview();\n    });\n  }\n\n  _disconnect_settings() {\n    this._prefs.SIGMA.disconnect();\n    this._prefs.BRIGHTNESS.disconnect();\n    this._prefs.WINDOW_CLASS_OVERRIDES.disconnect();\n  }\n\n  _update_sigma() {\n    let sigma = this._prefs.SIGMA.get();\n\n    this._panel_blur.set_sigma(sigma);\n    this._dash_to_dock_blur.set_sigma(sigma);\n    this._overview_blur.set_sigma(sigma);\n    this._lockscreen_blur.set_sigma(sigma);\n    this._applications_blur.set_sigma(sigma);\n    this._other_blur.set_sigma(sigma);\n    this._appfolders_blur.set_sigma(sigma);\n    this._window_list_blur.set_sigma(sigma);\n  }\n\n  _update_brightness() {\n    let brightness = this._prefs.BRIGHTNESS.get();\n\n    this._panel_blur.set_brightness(brightness);\n    this._dash_to_dock_blur.set_brightness(brightness);\n    this._overview_blur.set_brightness(brightness);\n    this._lockscreen_blur.set_brightness(brightness);\n    this._applications_blur.set_brightness(brightness);\n    this._other_blur.set_brightness(brightness);\n    this._appfolders_blur.set_brightness(brightness);\n    this._window_list_blur.set_brightness(brightness);\n  }\n\n  _log(str) {\n    if (this._prefs.DEBUG.get()) log(`[Blur Me] ${str}`);\n  }\n}\n\n// Called on gnome-shell loading, even if extension is deactivated\nfunction init() {\n  return new Extension();\n}\n"
  },
  {
    "path": "src/lockscreen.js",
    "content": "\"use strict\";\n\nconst { St, Shell } = imports.gi;\nconst Main = imports.ui.main;\nconst Background = imports.ui.background;\n\nlet sigma = 30;\nlet brightness = 0.6;\n\nconst original_createBackground =\n  imports.ui.unlockDialog.UnlockDialog.prototype._updateBackgroundEffects;\n\nvar LockscreenBlur = class LockscreenBlur {\n  constructor(connections, prefs) {\n    this.connections = connections;\n    this.prefs = prefs;\n  }\n\n  enable() {\n    this._log(\"blurring lockscreen\");\n\n    this.update_lockscreen();\n  }\n\n  update_lockscreen() {\n    imports.ui.unlockDialog.UnlockDialog.prototype._updateBackgroundEffects =\n      this._createBackground;\n  }\n\n  _createBackground() {\n    for (const widget of this._backgroundGroup) {\n      const effect = widget.get_effect(\"blur\");\n\n      if (effect) {\n        effect.set({\n          brightness: brightness,\n          sigma: sigma,\n        });\n      }\n    }\n  }\n\n  set_sigma(s) {\n    sigma = s;\n    this.update_lockscreen();\n  }\n\n  set_brightness(b) {\n    brightness = b;\n    this.update_lockscreen();\n  }\n\n  disable() {\n    this._log(\"removing blur from lockscreen\");\n\n    imports.ui.unlockDialog.UnlockDialog.prototype._updateBackgroundEffects =\n      original_createBackground;\n\n    this.connections.disconnect_all();\n  }\n\n  _log(str) {\n    if (this.prefs.DEBUG.get()) log(`[Blur Me] ${str}`);\n  }\n};\n"
  },
  {
    "path": "src/metadata.json",
    "content": "{\n    \"description\": \"Blur: Applications | Top Panel | Overview | Dash | More!\\n\\n\\nCredit where it's due: Overview and dash blur are based on blur my shell\",\n    \"name\": \"Blur Me\",\n    \"shell-version\": [\n        \"40\",\n        \"40.1\",\n        \"41\"\n    ],\n    \"url\": \"https://github.com/ckissane/blur-me\",\n    \"uuid\": \"blur-me@nunchucks\"\n}\n"
  },
  {
    "path": "src/other.js",
    "content": "\"use strict\";\n\nconst { St, Shell, Meta, Gio, GLib } = imports.gi;\nconst Main = imports.ui.main;\nconst Clutter = imports.gi.Clutter;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\nlet prefs = new Settings.Prefs();\n\nconst default_sigma = 30;\nconst default_brightness = 0.6;\n\nlet sigma = 30;\n\nvar OtherBlur = class OtherBlur {\n  constructor(connections) {\n    this.connections = connections;\n    this.effect = new Shell.BlurEffect({\n      brightness: default_brightness,\n      sigma: default_sigma,\n      mode: Shell.BlurMode.BACKGROUND,\n    });\n    this.windowActorBlurMap = new Map();\n    this.conspMap = new Map();\n    this.pid = 0;\n    this.addNotifInterval = undefined;\n    this.keyboardActor = undefined;\n    this.fixBlurInterval = Utils.setInterval(() => this.fix_blur(), 1);\n  }\n  create_blur_actor(pid) {\n    let wab = this.windowActorBlurMap.get(pid);\n    let meta_window = wab.window;\n    let window_actor = wab.actor;\n    let cons = this.conspMap.has(pid) ? this.conspMap.get(pid) : undefined;\n    let con = cons ? cons : window_actor;\n\n    let blurEffect = new Shell.BlurEffect({\n      brightness: this.effect.brightness,\n      sigma: this.effect.sigma,\n      mode: this.effect.mode,\n    });\n    // const frame = meta_window.get_frame_rect();\n    // const buffer = meta_window.get_buffer_rect();\n    const offsetX = 0; //frame.x - buffer.x;\n    const offsetY = 0; //frame.y - buffer.y;\n    const offsetWidth = 0; //buffer.width - frame.width;\n    const offsetHeight = 0; //buffer.height - frame.height;\n\n    let constraintPosX = new Clutter.BindConstraint({\n      source: con,\n      coordinate: Clutter.BindCoordinate.X,\n      offset: offsetX,\n    });\n    let constraintPosY = new Clutter.BindConstraint({\n      source: con,\n      coordinate: Clutter.BindCoordinate.Y,\n      offset: offsetY,\n    });\n\n    let constraintSizeX = new Clutter.BindConstraint({\n      source: con,\n      coordinate: Clutter.BindCoordinate.WIDTH,\n      offset: -offsetWidth,\n    });\n    let constraintSizeY = new Clutter.BindConstraint({\n      source: con,\n      coordinate: Clutter.BindCoordinate.HEIGHT,\n      offset: -offsetHeight,\n    });\n\n    let blurActor = new Clutter.Actor({\n      fixedPositionSet: true,\n      fixedX: 0,\n      fixedY: 0,\n    });\n    blurActor.add_constraint(constraintPosX);\n    blurActor.add_constraint(constraintPosY);\n    blurActor.add_constraint(constraintSizeX);\n    blurActor.add_constraint(constraintSizeY);\n\n    blurActor.add_effect_with_name(\"blur-effect\", blurEffect);\n    wab.blurActor = blurActor;\n    if (wab.actor.visible) {\n      blurActor.show();\n    } else {\n      blurActor.hide();\n    }\n    this.connections.connect(wab.actor, \"notify\", () => {\n      blurActor.remove_constraint(constraintPosX);\n      blurActor.remove_constraint(constraintPosY);\n      blurActor.remove_constraint(constraintSizeX);\n      blurActor.remove_constraint(constraintSizeY);\n      constraintPosX = new Clutter.BindConstraint({\n        source: con,\n        coordinate: Clutter.BindCoordinate.X,\n        offset: offsetX,\n      });\n      constraintPosY = new Clutter.BindConstraint({\n        source: con,\n        coordinate: Clutter.BindCoordinate.Y,\n        offset: offsetY,\n      });\n\n      constraintSizeX = new Clutter.BindConstraint({\n        source: con,\n        coordinate: Clutter.BindCoordinate.WIDTH,\n        offset: -offsetWidth,\n      });\n      constraintSizeY = new Clutter.BindConstraint({\n        source: con,\n        coordinate: Clutter.BindCoordinate.HEIGHT,\n        offset: -offsetHeight,\n      });\n\n      blurActor.add_constraint(constraintPosX);\n      blurActor.add_constraint(constraintPosY);\n      blurActor.add_constraint(constraintSizeX);\n      blurActor.add_constraint(constraintSizeY);\n    });\n\n    return blurActor;\n  }\n\n  update_blur(pid) {\n    if (this.windowActorBlurMap.has(pid)) {\n      let wab = this.windowActorBlurMap.get(pid);\n      if (wab.blurActor) {\n        this.update_blur_actor(pid);\n      } else {\n        this.init_blur_actor(pid);\n      }\n    }\n  }\n\n  set_blur_behind(blurActor, actor) {\n    if (actor.get_parent() === blurActor.get_parent()) {\n      actor.get_parent().set_child_below_sibling(blurActor, actor);\n    }\n  }\n\n  remove_blur(pid) {\n    if (this.windowActorBlurMap.has(pid)) {\n      let wab = this.windowActorBlurMap.get(pid);\n      delete wab.window[\"blur_provider_pid\"];\n      wab.blurActor.get_parent().remove_actor(wab.blurActor);\n      this.windowActorBlurMap.delete(pid);\n    }\n  }\n\n  update_blur_actor(pid) {\n    if (this.windowActorBlurMap.has(pid)) {\n      let wab = this.windowActorBlurMap.get(pid);\n      let blur_actor = wab.blurActor;\n      if (blur_actor) {\n        let blurEffect = new Shell.BlurEffect({\n          brightness: this.effect.brightness,\n          sigma: this.effect.sigma,\n          mode: this.effect.mode,\n        });\n        blur_actor.remove_effect_by_name(\"blur-effect\");\n        blur_actor.add_effect_with_name(\"blur-effect\", blurEffect);\n      }\n    }\n  }\n\n  init_blur_actor(pid, get_p) {\n    let wab = this.windowActorBlurMap.get(pid);\n    if (!wab.blurActor) {\n      let blurActor = this.create_blur_actor(pid);\n      wab.blurActor = blurActor;\n      try {\n        if (get_p) {\n          get_p(wab.actor)\n            .get_parent()\n            .insert_child_below(blurActor, get_p(wab.actor));\n        } else {\n          wab.actor.get_parent().insert_child_below(blurActor, wab.actor);\n        }\n      } catch (e) {\n        global.fai = e;\n      }\n      blurActor[\"blur_provider_pid\"] = pid;\n      let lis = (window_actor) => {\n        let pid = window_actor.blur_provider_pid;\n        if (this.windowActorBlurMap.has(pid)) {\n          let blurActor = this.windowActorBlurMap.get(pid).blurActor;\n          if (blurActor) {\n            if (window_actor.visible) {\n              blurActor.show();\n            } else {\n              blurActor.hide();\n            }\n          }\n        }\n      };\n      lis(wab.actor);\n      this.connections.connect(wab.actor, \"notify\", lis);\n    }\n  }\n\n  track_new(actor, window) {\n    let pid = window[\"blur_provider_pid\"] || this.pid++;\n    if (!this.windowActorBlurMap.has(pid)) {\n      actor[\"blur_provider_pid\"] = pid;\n      window[\"blur_provider_pid\"] = pid;\n      let wab = { window: window, actor: actor, blurActor: null };\n      this.windowActorBlurMap.set(pid, wab);\n      this.connections.connect(actor, \"destroy\", (window_actor) => {\n        this.actor_destroyed(window_actor);\n      });\n      // this.connections.connect(window, \"unmanaged\", (meta_window) =>\n      //   this.window_unmanaged(meta_window)\n      // );\n      this.update_blur(pid);\n    }\n  }\n\n  cleanup_things() {\n    this.windowActorBlurMap.forEach((value, pid) => {\n      this.destroy_wab(pid);\n    });\n  }\n\n  focus_changed() {\n    if (this.windowActorBlurMap.size > 0) {\n      Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => this.fix_blur());\n    }\n  }\n\n  blur_setting_changed() {\n    this.windowActorBlurMap.forEach((wab, pid) => {\n      this.update_blur(pid);\n    });\n  }\n\n  fix_blur() {\n    this.windowActorBlurMap.forEach((wab) => {\n      this.set_blur_behind(wab.blurActor, wab.actor);\n    });\n  }\n\n  destroy_wab(pid) {\n    this.remove_blur(pid);\n    this.windowActorBlurMap.delete(pid);\n  }\n  window_unmanaged(meta_window) {\n    this._log(\"window_unmanaged\");\n    try {\n      let pid = meta_window.blur_provider_pid;\n      this.destroy_wab(pid);\n    } catch (e) {}\n  }\n\n  actor_destroyed(window_actor) {\n    let pid = window_actor.blur_provider_pid;\n    try {\n      let pid = meta_window.blur_provider_pid;\n      this.destroy_wab(pid);\n    } catch (e) {}\n  }\n\n  window_created(meta_display, meta_window, getActor) {\n    log(\"other thing created\");\n    if (!meta_window) {\n      this._log(\"no other thing\");\n      return;\n    }\n    try {\n      let window_actor = getActor\n        ? getActor(meta_window)\n        : meta_window.get_compositor_private();\n      this.track_new(window_actor, meta_window);\n    } catch (e) {\n      this._log(\"failed to get actor for \" + meta_window);\n    }\n  }\n  enable() {\n    this._log(\"blurring other\");\n    if (Main.keyboard.keyboardActor) {\n      this.conspMap.set(this.pid, Main.keyboard.keyboardActor);\n      this.window_created(undefined, Main.keyboard, (x) => {\n        let c = x.keyboardActor.get_children();\n        return c[Math.min(c.length - 1,1)];\n      });\n    }\n    this.keyboardActor = Main.keyboard.keyboardActor;\n    this.connections.connect(Main.uiGroup, \"actor-added\", (_, actor) => {\n      if (Main.keyboard.keyboardActor && !this.keyboardActor) {\n        this.conspMap.set(this.pid, Main.keyboard.keyboardActor);\n        this.window_created(undefined, Main.keyboard, (x) => {\n          let c = x.keyboardActor.get_children();\n          return c[Math.min(c.length - 1,1)];\n        });\n\n        this.keyboardActor = Main.keyboard.keyboardActor;\n      }\n    });\n    Main.createLookingGlass();\n    this.conspMap.set(this.pid, Main.lookingGlass.actor);\n    this.window_created(undefined, Main.lookingGlass, (x) => {\n      return x.actor;\n    });\n    let addMC = () => {\n      if (Main.messageTray && Main.messageTray._bannerBin) {\n        let cc = Main.messageTray._bannerBin.get_children();\n        for (let c of cc) {\n          let wi = c.get_children()[0];\n          let pid = wi[\"blur_provider_pid\"] || this.pid;\n          this.conspMap.set(pid, wi);\n          this.window_created(undefined, wi, (x) => {\n            return x.get_children()[0].actor;\n          });\n        }\n      }\n    };\n    this.addNotifInterval = Utils.setInterval(() => {\n      addMC();\n    }, 1);\n  }\n\n  get monitor() {\n    return Main.layoutManager.primaryMonitor;\n  }\n\n  set_sigma(s) {\n    this.effect.sigma = s;\n    this.blur_setting_changed();\n  }\n\n  set_brightness(b) {\n    this.effect.brightness = b;\n    this.blur_setting_changed();\n  }\n\n  disable() {\n    this._log(\"removing blur from other\");\n\n    try {\n      this.cleanup_things();\n    } catch (e) {}\n    if (this.addNotifInterval !== undefined) {\n      Utils.clearInterval(this.addNotifInterval);\n    }\n    this.connections.disconnect_all();\n  }\n\n  show() {}\n\n  hide() {}\n\n  _log(str) {\n    log(`[Blur Me] ${str}`);\n  }\n};\n"
  },
  {
    "path": "src/overview.js",
    "content": "'use strict';\n\nconst { Shell, Gio, Meta } = imports.gi;\nconst Main = imports.ui.main;\nconst WorkspaceAnimationController =\n    imports.ui.workspaceAnimation.WorkspaceAnimationController;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\n\nvar OverviewBlur = class OverviewBlur {\n    constructor(connections, prefs) {\n        this.connections = connections;\n        this.effects = [];\n        this.prefs = prefs;\n        this._workspace_switch_bg_actors = [];\n    }\n\n    enable() {\n        this._log('blurring overview');\n\n        // connect to every background change (even without changing image)\n        this.connections.connect(\n            Main.layoutManager._backgroundGroup,\n            'notify',\n            () => {\n                this._log('updated background');\n                this.update_backgrounds();\n            }\n        );\n\n        // connect to monitors change\n        this.connections.connect(Main.layoutManager, 'monitors-changed', () => {\n            if (Main.screenShield && !Main.screenShield.locked) {\n                this._log('changed monitors');\n                this.update_backgrounds();\n            }\n        });\n\n        // add css class names, to change folders and workspace-switch background\n        Main.uiGroup.add_style_class_name('blurred-overview');\n\n        // update background on extension activation\n        // the try/catch behaviour is used to prevent bugs like #136 and #137\n        try {\n            this.update_backgrounds();\n        } catch (error) {\n            this._log(`could not blur overview: ${error}`);\n        }\n\n        // store original methods for restoring them on disable()\n        this._origPrepareSwitch =\n            WorkspaceAnimationController.prototype._prepareWorkspaceSwitch;\n        this._origFinishSwitch =\n            WorkspaceAnimationController.prototype._finishWorkspaceSwitch;\n\n        const outerThis = this;\n\n        // create blurred background actors for each monitor during a workspace switch\n        WorkspaceAnimationController.prototype._prepareWorkspaceSwitch =\n            function (...params) {\n                outerThis._log('prepare workspace switch');\n                outerThis._origPrepareSwitch.apply(this, params);\n\n                Main.layoutManager.monitors.forEach((monitor) => {\n                    if (\n                        !(\n                            Meta.prefs_get_workspaces_only_on_primary() &&\n                            monitor != Main.layoutManager.primaryMonitor\n                        )\n                    ) {\n                        const bg_actor =\n                            outerThis.create_background_actor(monitor);\n                        Main.uiGroup.insert_child_above(\n                            bg_actor,\n                            global.window_group\n                        );\n\n                        // store the actors so that we can delete them later\n                        outerThis._workspace_switch_bg_actors.push(bg_actor);\n                    }\n                });\n            };\n\n        // remove the workspace-switch actors when the switch is done\n        WorkspaceAnimationController.prototype._finishWorkspaceSwitch =\n            function (...params) {\n                outerThis._log('finish workspace switch');\n                outerThis._origFinishSwitch.apply(this, params);\n\n                outerThis._workspace_switch_bg_actors.forEach((actor) => {\n                    actor.destroy();\n                });\n                outerThis._workspace_switch_bg_actors = [];\n            };\n    }\n\n    update_backgrounds() {\n        // remove every old background\n        Main.layoutManager.overviewGroup.get_children().forEach((actor) => {\n            if (actor.constructor.name == 'Meta_BackgroundActor') {\n                Main.layoutManager.overviewGroup.remove_child(actor);\n                actor.destroy();\n            }\n        });\n        this.effects = [];\n\n        // add new backgrounds\n        Main.layoutManager.monitors.forEach((monitor) => {\n            const bg_actor = this.create_background_actor(monitor);\n            Main.layoutManager.overviewGroup.insert_child_at_index(\n                bg_actor,\n                monitor.index\n            );\n        });\n    }\n\n    create_background_actor(monitor) {\n        let bg_actor = new Meta.BackgroundActor();\n\n        let background = Main.layoutManager._backgroundGroup.get_child_at_index(\n            Main.layoutManager.monitors.length - monitor.index - 1\n        );\n        bg_actor.set_content(background.get_content());\n\n        let effect = new Shell.BlurEffect({\n            brightness: this.prefs.BRIGHTNESS.get(),\n            sigma: this.prefs.SIGMA.get(),\n            mode: 0\n        });\n        bg_actor.add_effect(effect);\n        this.effects.push(effect);\n\n        bg_actor.set_x(monitor.x);\n        bg_actor.set_y(monitor.y);\n\n        return bg_actor;\n    }\n\n    set_sigma(s) {\n        this.effects.forEach((effect) => {\n            effect.sigma = s;\n        });\n    }\n\n    set_brightness(b) {\n        this.effects.forEach((effect) => {\n            effect.brightness = b;\n        });\n    }\n\n    disable() {\n        this._log('removing blur from overview');\n        Main.layoutManager.overviewGroup.get_children().forEach((actor) => {\n            if (actor.constructor.name == 'Meta_BackgroundActor') {\n                Main.layoutManager.overviewGroup.remove_child(actor);\n            }\n        });\n        Main.uiGroup.remove_style_class_name('blurred-overview');\n\n        this.effects = [];\n        this.connections.disconnect_all();\n\n        // restore original behavior\n        WorkspaceAnimationController.prototype._prepareWorkspaceSwitch =\n            this._origPrepareSwitch;\n        WorkspaceAnimationController.prototype._finishWorkspaceSwitch =\n            this._origFinishSwitch;\n    }\n\n    _log(str) {\n        if (this.prefs.DEBUG.get()) log(`[Blur Me] ${str}`);\n    }\n};\n"
  },
  {
    "path": "src/paint_signals.js",
    "content": "'use strict'\n\nconst { GObject, Clutter } = imports.gi;\n\n\nvar PaintSignals = class PaintSignals {\n    constructor(connections) {\n        this.buffer = [];\n        this.connections = connections\n    }\n\n    connect(actor, blur_effect) {\n        let paint_effect = new EmitPaintSignal();\n        let infos = {\n            actor: actor,\n            paint_effect: paint_effect\n        };\n\n        actor.add_effect(paint_effect);\n        this.connections.connect(paint_effect, 'update-blur', () => {\n            try {\n                blur_effect.queue_repaint();\n            } catch (e) { }\n        });\n\n        this.buffer.push(infos)\n    }\n\n    disconnect_all() {\n        this.buffer.forEach((infos) => {\n            this.connections.disconnect_all_for(infos.paint_effect);\n            infos.actor.remove_effect(infos.paint_effect);\n        });\n\n        this.buffer = []\n    }\n}\n\nvar EmitPaintSignal = GObject.registerClass({\n    GTypeName: 'EmitPaintSignal',\n    Signals: {\n        'update-blur': {\n            param_types: []\n        },\n    }\n},\n    class EmitPaintSignal extends Clutter.Effect {\n        vfunc_paint(node, paint_context, paint_flags) {\n            this.emit(\"update-blur\");\n            super.vfunc_paint(node, paint_context, paint_flags);\n        }\n    }\n);"
  },
  {
    "path": "src/panel.js",
    "content": "'use strict';\n\nconst { St, Shell, Meta, Gio, GLib } = imports.gi;\nconst Main = imports.ui.main;\nconst backgroundSettings = new Gio.Settings({ schema: 'org.gnome.desktop.background' })\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\nconst PaintSignals = Me.imports.paint_signals;\n\nvar PanelBlur = class PanelBlur {\n    constructor(connections, prefs) {\n        this.connections = connections;\n        this.paint_signals = new PaintSignals.PaintSignals(connections);\n        this.prefs = prefs;\n        this.effect = new Shell.BlurEffect({\n            brightness: prefs.BRIGHTNESS.get(),\n            sigma: prefs.SIGMA.get(),\n            mode: prefs.STATIC_BLUR.get() ? 0 : 1\n        });\n        this.background_parent = new St.Widget({\n            name: 'topbar-blurred-background-parent',\n            style_class: 'topbar-blurred-background-parent',\n            x: 0,\n            y: 0,\n            width: this.monitor.width,\n            height: 0,\n        });\n        this.background = prefs.STATIC_BLUR.get() ? new Meta.BackgroundActor : new St.Widget({\n            style_class: 'topbar-blurred-background',\n            x: Main.panel.position.x,\n            y: Main.panel.position.y,\n            width: Main.panel.width,\n            height: Main.panel.height,\n        });\n        this.background_parent.add_child(this.background);\n    }\n\n    enable() {\n        this._log(\"blurring top panel\");\n\n        // insert background parent\n        let children = Main.layoutManager.panelBox.get_children();\n        for (let i = 0; i < children.length; ++i)\n            if (children[i].name == 'topbar-blurred-background-parent')\n                Main.layoutManager.panelBox.remove_child(children[i]);\n        Main.layoutManager.panelBox.insert_child_at_index(this.background_parent, 0);\n\n        // hide corners, can't style them\n        Main.panel._leftCorner.hide();\n        Main.panel._rightCorner.hide();\n        this.connections.connect(Main.panel._leftCorner, 'show', () => { Main.panel._leftCorner.hide() });\n        this.connections.connect(Main.panel._rightCorner, 'show', () => { Main.panel._rightCorner.hide() });\n\n        // remove background\n        Main.panel.add_style_class_name('transparent-panel');\n\n        // perform updates\n        this.change_blur_type();\n        Utils.setTimeout(() => { this.change_blur_type() }, 500);\n\n        // connect to panel size change\n        this.connections.connect(Main.panel, 'notify::height', () => {\n            this.update_size(this.prefs.STATIC_BLUR.get());\n        });\n        this.connections.connect(Main.panel, 'notify::width', () => {\n            this.update_size(prefs.STATIC_BLUR.get());\n        });\n        this.connections.connect(Main.panel, 'notify::position', () => {\n            this.update_size(prefs.STATIC_BLUR.get());\n        });\n\n        // connect to every background change (even without changing image)\n        this.connections.connect(Main.layoutManager._backgroundGroup, 'notify', () => {\n            this.update_wallpaper(this.prefs.STATIC_BLUR.get());\n        })\n\n        // connect to monitors change\n        this.connections.connect(Main.layoutManager, 'monitors-changed', () => {\n            if (Main.screenShield && !Main.screenShield.locked) {\n                this.update_wallpaper(this.prefs.STATIC_BLUR.get());\n                this.update_size(this.prefs.STATIC_BLUR.get());\n            }\n        });\n\n        this.connect_to_overview();\n    }\n\n    change_blur_type() {\n        let is_static = this.prefs.STATIC_BLUR.get();\n\n        // reset widgets to right state\n        this.background_parent.remove_child(this.background);\n        this.background.remove_effect(this.effect);\n        this.background = is_static ? new Meta.BackgroundActor : new St.Widget({\n            style_class: 'topbar-blurred-background',\n            x: Main.panel.position.x,\n            y: Main.panel.position.y,\n            width: Main.panel.width,\n            height: Main.panel.height,\n        });\n        this.effect.set_mode(is_static ? 0 : 1);\n        this.background.add_effect(this.effect);\n        this.background_parent.add_child(this.background);\n\n        // perform updates\n        this.update_wallpaper(is_static);\n        this.update_size(is_static);\n\n        // HACK\n        if (!is_static) {\n            // ! DIRTY PART: hack because `Shell.BlurEffect` does not repaint when shadows are under it\n            // ! this does not entirely fix this bug (shadows caused by windows still cause artefacts)\n            // ! but it prevents the shadows of the panel buttons to cause artefacts on the panel itself\n            // ! note: issue opened at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2857\n\n            if (this.prefs.HACKS_LEVEL.get() == 1) {\n                this._log(\"panel hack level 1\");\n                this.paint_signals.disconnect_all();\n\n                let rp = () => { this.effect.queue_repaint() };\n\n                this.connections.connect(Main.panel, 'enter-event', rp);\n                this.connections.connect(Main.panel, 'leave-event', rp);\n                this.connections.connect(Main.panel, 'button-press-event', rp);\n\n                Main.panel.get_children().forEach(child => {\n                    this.connections.connect(child, 'enter-event', rp);\n                    this.connections.connect(child, 'leave-event', rp);\n                    this.connections.connect(child, 'button-press-event', rp);\n                });\n            } else if (this.prefs.HACKS_LEVEL.get() == 2) {\n                this._log(\"panel hack level 2\");\n                this.paint_signals.disconnect_all();\n\n                this.paint_signals.connect(Main.panel, this.effect);\n                Main.panel.get_children().forEach(child => {\n                    this.paint_signals.connect(child, this.effect);\n                });\n            } else {\n                this.paint_signals.disconnect_all();\n            }\n\n            // ! END OF DIRTY PART\n        }\n    }\n\n    update_wallpaper(is_static) {\n        // if static blur, get right wallpaper and update blur with it\n        if (is_static) {\n            // the try/catch behaviour is used to prevent bugs like #136 and #137\n            try {\n                let bg = Main.layoutManager._backgroundGroup.get_child_at_index(Main.layoutManager.monitors.length - this.monitor.index - 1);\n                this.background.set_content(bg.get_content());\n            } catch (error) { this._log(`could not blur panel: ${error}`) }\n        }\n    }\n\n    update_size(is_static) {\n        this.background_parent.width = Main.panel.width;\n        this.background.width = Main.panel.width;\n        this.background.height = Main.panel.height;\n        let panel_box = Main.layoutManager.panelBox;\n        let clip_box = panel_box.get_parent();\n        if (is_static) {\n            this.background.set_clip(\n                clip_box.x,\n                clip_box.y,\n                panel_box.width,\n                panel_box.height\n            );\n            this.background.x = -clip_box.x;\n            this.background.y = -clip_box.y;\n        }\n    }\n\n    // returns either the primary monitor, or a dummy one if none is connected\n    get monitor() {\n        if (Main.layoutManager.primaryMonitor != null) {\n            return Main.layoutManager.primaryMonitor\n        } else {\n            return { x: 0, y: 0, width: 0, index: 0 }\n        }\n    }\n\n    // connect when overview if opened/closed to hide/show the blur in consequence\n    // if HIDETOPBAR set, we need just to hide the blur when showing appgrid (so no shadow is cropped)\n    connect_to_overview() {\n        this.connections.disconnect_all_for(Main.overview._overview._controls._appDisplay);\n        this.connections.disconnect_all_for(Main.overview);\n\n        if (!this.prefs.HIDETOPBAR.get()) {\n            this.connections.connect(Main.overview, 'showing', () => {\n                this.hide();\n            });\n            this.connections.connect(Main.overview, 'hidden', () => {\n                this.show();\n            });\n        } else {\n            this.connections.connect(Main.overview._overview._controls._appDisplay, 'show', () => {\n                this.hide();\n            });\n            this.connections.connect(Main.overview._overview._controls._appDisplay, 'hide', () => {\n                this.show();\n            });\n            this.connections.connect(Main.overview, 'hidden', () => {\n                this.show();\n            });\n        }\n    }\n\n    set_sigma(s) {\n        this.effect.sigma = s;\n    }\n\n    set_brightness(b) {\n        this.effect.brightness = b;\n    }\n\n    disable() {\n        this._log(\"removing blur from top panel\");\n        Main.panel.remove_style_class_name('transparent-panel');\n\n        try {\n            Main.layoutManager.panelBox.remove_child(this.background_parent);\n        } catch (e) { }\n\n        this.connections.disconnect_all();\n\n        Main.panel._leftCorner.show();\n        Main.panel._rightCorner.show();\n    }\n\n    show() {\n        this.background_parent.show();\n    }\n    hide() {\n        this.background_parent.hide();\n    }\n\n    _log(str) {\n\n        if (this.prefs.DEBUG.get())\n        log(`[Blur Me] ${str}`)\n    }\n}"
  },
  {
    "path": "src/panel_indicator.js",
    "content": "const { Clutter, GObject, St ,GLib} = imports.gi;\n\nconst ExtensionUtils = imports.misc.extensionUtils;\nconst Main = imports.ui.main;\nconst PanelMenu = imports.ui.panelMenu;\nconst PopupMenu = imports.ui.popupMenu;\n\nconst Gettext = imports.gettext.domain(\"gnome-shell-extensions\");\nconst _ = Gettext.gettext;\nconst N_ = (x) => x;\n\nconst Me = ExtensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\nlet prefs = new Settings.Prefs();\n\nvar BlurWindowMenuItem = GObject.registerClass(\n  class BlurWindowMenuItem extends PopupMenu.PopupBaseMenuItem {\n    _init(wm_class) {\n      super._init({\n        style_class: \"blur-window-menu-item\",\n      });\n      this._wm_class = wm_class;\n\n      this._label = new St.Label({\n        text: wm_class,\n        x_expand: true,\n        y_align: Clutter.ActorAlign.CENTER,\n      });\n      this.add_child(this._label);\n      this._toggleButton = new St.Button({\n        label: \"Toggle Blur\",\n        style_class: \"button\",\n      });\n      this._toggleButton.connect(\"clicked\", () => {\n        let p = prefs.WINDOW_CLASS_OVERRIDES.get();\n        p[wm_class] = p[wm_class] === false;\n        prefs.WINDOW_CLASS_OVERRIDES.set(p);\n      });\n      this.add_child(this._toggleButton);\n    }\n\n    destroy() {\n      super.destroy();\n    }\n\n    activate(event) {\n      super.activate(event);\n    }\n  }\n);\n\nconst SECTIONS = [\"windows\"];\n\nlet BlurMenu = GObject.registerClass(\n  class BlurMenu extends PanelMenu.Button {\n    _init() {\n      super._init(0.0, _(\"Toggle Application Blur\"));\n\n      let label = new St.Label({\n        text: _(\"Toggle Application Blur\"),\n        y_expand: true,\n        y_align: Clutter.ActorAlign.CENTER,\n      });\n      this.add_actor(label);\n\n      this._sections = {};\n\n      for (let i = 0; i < SECTIONS.length; i++) {\n        let id = SECTIONS[i];\n        if (id === \"windows\") {\n          this._sections[id] = new PopupMenu.PopupMenuSection();\n          global.display.connect(\n            \"window-created\",\n            (_meta_display, meta_window) => {\n              this._redisplay(id);\n              meta_window.connect(\"unmanaged\", () => {\n                this._redisplay(id);\n              });\n            }\n          );\n          this._create(id);\n          this.menu.addMenuItem(this._sections[id]);\n          this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());\n        }\n      }\n    }\n\n    _onDestroy() {\n      this.blurManager.destroy();\n\n      super._onDestroy();\n    }\n\n    _redisplay(id) {\n      this._sections[id].removeAll();\n\n      this._create(id);\n    }\n\n    _create(id) {\n      if (id === \"windows\") {\n        this._create_windows(id);\n      }\n    }\n    _create_windows(id) {\n      let wm_classes_set = new Set();\n      for (let wks = 0; wks < global.workspace_manager.n_workspaces; ++wks) {\n        let metaWorkspace =\n          global.workspace_manager.get_workspace_by_index(wks);\n        let windows = metaWorkspace.list_windows();\n        windows.forEach((v) => {\n          wm_classes_set.add(Utils.get_process_name_from_window(v));\n        });\n      }\n      let wm_classes = [...wm_classes_set];\n\n      for (let i = 0; i < wm_classes.length; i++)\n        this._sections[id].addMenuItem(new BlurWindowMenuItem(wm_classes[i]));\n\n      this._sections[id].actor.visible = true;\n    }\n  }\n);\n\nvar PanelIndicator = class PanelIndicator {\n  constructor(connections) {\n      this.connections = connections;\n      this._indicator = null;\n  }\n\n  enable() {\n    if (this._indicator) {\n      this._indicator.destroy();\n      this._indicator = null;\n    }\n    this._indicator = new BlurMenu();\n\n    let pos = Main.sessionMode.panel.left.indexOf(\"appMenu\");\n    if (\"apps-menu\" in Main.panel.statusArea) pos++;\n    Main.panel.addToStatusArea(\"blur-menu\", this._indicator, pos, \"left\");\n  }\n\n  disable() {\n    if (this._indicator) {\n      this._indicator.destroy();\n      this._indicator = null;\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/prefs.js",
    "content": "\"use strict\";\n\nconst { GObject, Gtk } = imports.gi;\n\nconst ExtensionUtils = imports.misc.extensionUtils;\nconst Extension = ExtensionUtils.getCurrentExtension();\nlet Settings = Extension.imports.settings;\nlet config = new Settings.Prefs();\n\nconst BlurMePrefsWidget = GObject.registerClass(\n  {\n    GTypeName: \"BlurMePrefsWidget\",\n    Template: Extension.dir.get_child(\"prefs.ui\").get_uri(),\n    InternalChildren: [\n      \"sigma_scale\",\n      \"brightness_scale\",\n      \"blur_dash\",\n      \"blur_panel\",\n      \"blur_overview\",\n      \"blur_lockscreen\",\n        'blur_appfolders',\n        'blur_window_list',\n      \"blur_applications\",\n      \"blur_other\",\n      \"hacks_level0\",\n      \"hacks_level1\",\n      \"hacks_level2\",\n      \"dash_opacity_scale\",\n        'appfolder_dialog_opacity_scale',\n      \"static_blur\",\n      \"toggle_app_blur\",\n\n        'hidetopbar',\n        'debug_mode',\n    ],\n  },\n  class BlurMePrefsWidget extends Gtk.Box {\n    _init(params = {}) {\n      super._init(params);\n\n      // ! sigma\n      this._sigma_scale.set_value(config.SIGMA.get());\n\n      // ! brightness\n      this._brightness_scale.set_value(config.BRIGHTNESS.get());\n\n      // ! blur dash\n      this._blur_dash.set_active(config.BLUR_DASH.get());\n\n      // ! blur panel\n      this._blur_panel.set_active(config.BLUR_PANEL.get());\n\n      // ! blur overview\n      this._blur_overview.set_active(config.BLUR_OVERVIEW.get());\n\n      // ! blur lockscreen\n      this._blur_lockscreen.set_active(config.BLUR_LOCKSCREEN.get());\n\n      // ! blur applications\n      this._blur_applications.set_active(config.BLUR_APPLICATIONS.get());\n        // ! blur appfolders\n        this._blur_appfolders.set_active(config.BLUR_APPFOLDERS.get());\n\n        // ! blur window list\n        this._blur_window_list.set_active(config.BLUR_WINDOW_LIST.get());\n\n        // ! dash hacks\n        if (config.HACKS_LEVEL.get() == 0) {\n            this._hacks_level0.set_active(true);\n        } else if (config.HACKS_LEVEL.get() == 1) {\n            this._hacks_level1.set_active(true);\n        } else if (config.HACKS_LEVEL.get() == 2) {\n            this._hacks_level2.set_active(true);\n        } else {\n            this._log(`hack level out-of-bound: ${hack_level}, defaulting to 1.`);\n            this._hacks_level0.set_active(true);\n        }\n\n      this._blur_other.set_active(config.BLUR_OTHER.get());\n\n      this._toggle_app_blur.set_active(config.TOGGLE_APP_BLUR.get());\n\n      // ! dash hacks\n      if (config.HACKS_LEVEL.get() == 0) {\n        this._hacks_level0.set_active(true);\n      } else if (config.HACKS_LEVEL.get() == 1) {\n        this._hacks_level1.set_active(true);\n      } else if (config.HACKS_LEVEL.get() == 2) {\n        this._hacks_level2.set_active(true);\n      } else {\n        this._log(`hack level out-of-bound: ${hack_level}, defaulting to 1.`);\n        this._hacks_level0.set_active(true);\n      }\n\n      // ! dash opacity\n      this._dash_opacity_scale.set_value(config.DASH_OPACITY.get());\n\n      // ! static panel blur\n      this._static_blur.set_active(config.STATIC_BLUR.get());\n        // ! appfolder dialog opacity\n        this._appfolder_dialog_opacity_scale.set_value(config.APPFOLDER_DIALOG_OPACITY.get());\n\n        // ! static panel blur\n        this._static_blur.set_active(config.STATIC_BLUR.get());\n\n        // ! hidetopbar compatibility\n        this._hidetopbar.set_active(config.HIDETOPBAR.get());\n\n        // ! debug mode\n        this._debug_mode.set_active(config.DEBUG.get());\n    }\n\n    sigma_changed(w) {\n      let value = w.get_value();\n      config.SIGMA.set(value);\n      this.set_data_w();\n    }\n\n    brightness_changed(w) {\n      let value = w.get_value();\n      config.BRIGHTNESS.set(value);\n    }\n\n    blur_dash_toggled(w) {\n      let value = w.get_active();\n      config.BLUR_DASH.set(value);\n    }\n\n    blur_panel_toggled(w) {\n      let value = w.get_active();\n      config.BLUR_PANEL.set(value);\n    }\n\n    blur_overview_toggled(w) {\n      let value = w.get_active();\n      config.BLUR_OVERVIEW.set(value);\n    }\n\n    blur_lockscreen_toggled(w) {\n      let value = w.get_active();\n      config.BLUR_LOCKSCREEN.set(value);\n    }\n\n    blur_applications_toggled(w) {\n      let value = w.get_active();\n      config.BLUR_APPLICATIONS.set(value);\n    }\n\n    blur_other_toggled(w) {\n      let value = w.get_active();\n      config.BLUR_OTHER.set(value);\n    }\n\n    toggle_app_blur_toggled(w) {\n      let value = w.get_active();\n      config.TOGGLE_APP_BLUR.set(value);\n    }\n\n    blur_appfolders_toggled(w) {\n        let value = w.get_active();\n        config.BLUR_APPFOLDERS.set(value);\n    }\n\n    blur_window_list_toggled(w) {\n        let value = w.get_active();\n        config.BLUR_WINDOW_LIST.set(value);\n    }\n\n    hacks_level0_toggled(w) {\n      let is_active = w.get_active();\n      if (is_active) {\n        config.HACKS_LEVEL.set(0);\n      }\n    }\n\n    hacks_level1_toggled(w) {\n      let is_active = w.get_active();\n      if (is_active) {\n        config.HACKS_LEVEL.set(1);\n      }\n    }\n\n    hacks_level2_toggled(w) {\n      let is_active = w.get_active();\n      if (is_active) {\n        config.HACKS_LEVEL.set(2);\n      }\n    }\n\n    dash_opacity_changed(w) {\n      let value = w.get_value();\n      config.DASH_OPACITY.set(value);\n    }\n\n    appfolder_dialog_opacity_changed(w) {\n        let value = w.get_value();\n        config.APPFOLDER_DIALOG_OPACITY.set(value);\n    }\n\n    static_blur_toggled(w) {\n        let value = w.get_active();\n        config.STATIC_BLUR.set(value);\n    }\n\n    hidetopbar_toggled(w) {\n        let value = w.get_active();\n        config.HIDETOPBAR.set(value);\n    }\n\n    debug_mode_toggled(w) {\n        let value = w.get_active();\n        config.DEBUG.set(value);\n    }\n\n    _log(str) {\n        if (config.DEBUG.get())\n            log(`[Blur Me] ${str}`)\n    }\n  }\n);\n\nfunction init() {}\n\nfunction buildPrefsWidget() {\n  return new BlurMePrefsWidget();\n}\n"
  },
  {
    "path": "src/prefs.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<interface>\n  <requires lib=\"gtk\" version=\"4.0\" />\n  <template class=\"BlurMePrefsWidget\" parent=\"GtkBox\">\n\n    <object class=\"GtkAdjustment\" id=\"brightness_adjustment\">\n      <property name=\"upper\">1</property>\n      <property name=\"step_increment\">1</property>\n      <property name=\"page_increment\">10</property>\n    </object>\n    <object class=\"GtkAdjustment\" id=\"sigma_adjustment\">\n      <property name=\"upper\">150</property>\n      <property name=\"step_increment\">1</property>\n      <property name=\"page_increment\">10</property>\n    </object>\n    <object class=\"GtkAdjustment\" id=\"dash_opacity_adjustment\">\n      <property name=\"upper\">1</property>\n      <property name=\"step_increment\">1</property>\n      <property name=\"page_increment\">10</property>\n    </object>\n    <object class=\"GtkAdjustment\" id=\"appfolder_dialog_opacity_adjustment\">\n      <property name=\"upper\">1</property>\n      <property name=\"step_increment\">1</property>\n      <property name=\"page_increment\">10</property>\n    </object>\n\n    <child>\n      <object class=\"GtkGrid\" id=\"main_frame\">\n        <property name=\"can_focus\">0</property>\n        <property name=\"row_spacing\">6</property>\n        <property name=\"column_spacing\">2</property>\n        <property name=\"column_homogeneous\">1</property>\n\n        <!--! BLUR PREFERENCES -->\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Brightness</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">0</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkScale\" id=\"brightness_scale\">\n            <property name=\"draw-value\">1</property>\n            <property name=\"adjustment\">brightness_adjustment</property>\n            <property name=\"round_digits\">2</property>\n            <property name=\"digits\">2</property>\n            <property name=\"value_pos\">right</property>\n            <signal name=\"value-changed\" handler=\"brightness_changed\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">0</property>\n            </layout>\n          </object>\n        </child>\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Sigma</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">1</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkScale\" id=\"sigma_scale\">\n            <property name=\"draw-value\">1</property>\n            <property name=\"adjustment\">sigma_adjustment</property>\n            <property name=\"round_digits\">0</property>\n            <property name=\"digits\">0</property>\n            <property name=\"value_pos\">right</property>\n            <signal name=\"value-changed\" handler=\"sigma_changed\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">1</property>\n            </layout>\n          </object>\n        </child>\n\n        <!--! BLUR SWITCHES !-->\n\n        <child>\n          <object class=\"GtkSeparator\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"orientation\">vertical</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">2</property>\n              <property name=\"column-span\">2</property>\n            </layout>\n          </object>\n        </child>\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Blur</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">3</property>\n              <property name=\"row-span\">5</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_dash\">\n            <property name=\"label\" translatable=\"yes\">dash</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_dash_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">3</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_panel\">\n            <property name=\"label\" translatable=\"yes\">panel</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_panel_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">4</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_overview\">\n            <property name=\"label\" translatable=\"yes\">overview</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_overview_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">5</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_lockscreen\">\n            <property name=\"label\" translatable=\"yes\">lockscreen</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_lockscreen_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">6</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_applications\">\n            <property name=\"label\" translatable=\"yes\">applications</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_applications_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">7</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_appfolders\">\n            <property name=\"label\" translatable=\"yes\">app folders</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_appfolders_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">8</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_other\">\n            <property name=\"label\" translatable=\"yes\">Other (on screen keyboard, shell popups, etc.)</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_other_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">9</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"blur_window_list\">\n            <property name=\"label\" translatable=\"yes\">window list extension</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"blur_window_list_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">10</property>\n            </layout>\n          </object>\n        </child>\n\n        <!--! HACKS !-->\n\n        <child>\n          <object class=\"GtkSeparator\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"orientation\">vertical</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">10</property>\n              <property name=\"column-span\">2</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Exclude Applications</property>\n            <property name=\"use_markup\">1</property>\n            <property name=\"justify\">center</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">11</property>\n              <property name=\"row-span\">1</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"toggle_app_blur\">\n            <property name=\"label\" translatable=\"yes\">Show application blur menu in panel</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"toggle_app_blur_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">11</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Artefacts hacks\n(needs re-enabling extension)</property>\n            <property name=\"use_markup\">1</property>\n            <property name=\"justify\">center</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">12</property>\n              <property name=\"row-span\">3</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"hacks_level0\">\n            <property name=\"label\" translatable=\"yes\">lots of artefacts, good perfs</property>\n            <property name=\"active\">0</property>\n            <signal name=\"toggled\" handler=\"hacks_level0_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">13</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"hacks_level1\">\n            <property name=\"label\" translatable=\"yes\">some artefacts, perfs OK+</property>\n            <property name=\"active\">1</property>\n            <property name=\"group\">hacks_level0</property>\n            <signal name=\"toggled\" handler=\"hacks_level1_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">14</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"hacks_level2\">\n            <property name=\"label\" translatable=\"yes\">nearly no artefacts, bad perfs</property>\n            <property name=\"active\">0</property>\n            <property name=\"group\">hacks_level0</property>\n            <signal name=\"toggled\" handler=\"hacks_level2_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">15</property>\n            </layout>\n          </object>\n        </child>\n\n        <!--! OPACITY OPTIONS !-->\n\n        <child>\n          <object class=\"GtkSeparator\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"orientation\">vertical</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">17</property>\n              <property name=\"column-span\">2</property>\n            </layout>\n          </object>\n        </child>\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Dash opacity</property>\n            <property name=\"use_markup\">1</property>\n            <property name=\"justify\">center</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">18</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkScale\" id=\"dash_opacity_scale\">\n            <property name=\"draw-value\">1</property>\n            <property name=\"adjustment\">dash_opacity_adjustment</property>\n            <property name=\"round_digits\">2</property>\n            <property name=\"digits\">2</property>\n            <property name=\"value_pos\">right</property>\n            <signal name=\"value-changed\" handler=\"dash_opacity_changed\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">18</property>\n            </layout>\n          </object>\n        </child>\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Appfolder dialog opacity</property>\n            <property name=\"use_markup\">1</property>\n            <property name=\"justify\">center</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">20</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkScale\" id=\"appfolder_dialog_opacity_scale\">\n            <property name=\"draw-value\">1</property>\n            <property name=\"adjustment\">appfolder_dialog_opacity_adjustment</property>\n            <property name=\"round_digits\">2</property>\n            <property name=\"digits\">2</property>\n            <property name=\"value_pos\">right</property>\n            <signal name=\"value-changed\" handler=\"appfolder_dialog_opacity_changed\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">20</property>\n            </layout>\n          </object>\n        </child>\n\n        <!--! MISC -->\n\n        <child>\n          <object class=\"GtkSeparator\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"orientation\">vertical</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">21</property>\n              <property name=\"column-span\">2</property>\n            </layout>\n          </object>\n        </child>\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Static panel blur</property>\n            <property name=\"use_markup\">1</property>\n            <property name=\"justify\">center</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">22</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"static_blur\">\n            <property name=\"label\" translatable=\"yes\">(refresh by going in/out of overview)</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"static_blur_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">22</property>\n            </layout>\n          </object>\n        </child>\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Compatibility with hidetopbar</property>\n            <property name=\"use_markup\">1</property>\n            <property name=\"justify\">center</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">23</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"hidetopbar\">\n            <property name=\"active\">1</property>\n            <property name=\"label\" translatable=\"yes\">(do not disable blur in overview, best with static-blur)</property>\n            <signal name=\"toggled\" handler=\"hidetopbar_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">23</property>\n            </layout>\n          </object>\n        </child>\n\n        <child>\n          <object class=\"GtkLabel\">\n            <property name=\"can_focus\">0</property>\n            <property name=\"label\" translatable=\"yes\">Debug mode</property>\n            <property name=\"use_markup\">1</property>\n            <property name=\"justify\">center</property>\n            <layout>\n              <property name=\"column\">0</property>\n              <property name=\"row\">24</property>\n            </layout>\n          </object>\n        </child>\n        <child>\n          <object class=\"GtkCheckButton\" id=\"debug_mode\">\n            <property name=\"label\" translatable=\"yes\">(adds some logs, useful when reporting an issue)</property>\n            <property name=\"active\">1</property>\n            <signal name=\"toggled\" handler=\"debug_mode_toggled\" swapped=\"no\" />\n            <layout>\n              <property name=\"column\">1</property>\n              <property name=\"row\">24</property>\n            </layout>\n          </object>\n        </child>\n\n      </object>\n    </child>\n  </template>\n</interface>"
  },
  {
    "path": "src/schemas/org.gnome.shell.extensions.blur-me.gschema.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<schemalist>\n    <schema id=\"org.gnome.shell.extensions.blur-me\" path=\"/org/gnome/shell/extensions/blur-me/\">\n        <!-- SIGMA -->\n        <key type=\"i\" name=\"sigma\">\n            <default>30</default>\n            <summary>Global sigma (gaussian blur radius) to use</summary>\n            <description />\n        </key>\n        <!-- BRIGHTNESS -->\n        <key type=\"d\" name=\"brightness\">\n            <default>0.6</default>\n            <summary>Global brightness to use</summary>\n            <description />\n        </key>\n        <!-- BLUR DASH -->\n        <key type=\"b\" name=\"blur-dash\">\n            <default>true</default>\n            <summary>Boolean, whether to blur the dash or not</summary>\n            <description />\n        </key>\n        <!-- BLUR PANEL -->\n        <key type=\"b\" name=\"blur-panel\">\n            <default>true</default>\n            <summary>Boolean, whether to blur the panel or not</summary>\n            <description />\n        </key>\n        <!-- BLUR OVERVIEW -->\n        <key type=\"b\" name=\"blur-overview\">\n            <default>true</default>\n            <summary>Boolean, whether to blur the overview or not</summary>\n            <description />\n        </key>\n        <!-- BLUR LOCKSCREEN -->\n        <key type=\"b\" name=\"blur-lockscreen\">\n            <default>true</default>\n            <summary>Boolean, whether to blur lockscreen or not</summary>\n            <description />\n        </key>\n        <!-- BLUR APPLICATIONS -->\n        <key type=\"b\" name=\"blur-applications\">\n            <default>true</default>\n            <summary>Boolean, whether to blur applications or not</summary>\n            <description />\n        </key>\n        <key type=\"b\" name=\"toggle-app-blur\">\n            <default>true</default>\n            <summary>Boolean, whether to show toggle application blur button in panel</summary>\n            <description />\n        </key>\n        <key type=\"s\" name=\"window-class-overrides\">\n            <default>\"{}\"</default>\n            <summary>String, json map for window class blur overrides</summary>\n            <description />\n        </key>\n        <key type=\"b\" name=\"blur-other\">\n            <default>true</default>\n            <summary>Boolean, whether to blur things like onscreen keyboard, notifications section, etc.</summary>\n        </key>\n        <!-- BLUR APPFOLDERS -->\n        <key type=\"b\" name=\"blur-appfolders\">\n            <default>true</default>\n            <summary>Boolean, whether to blur appfolders or not</summary>\n            <description />\n        </key>\n        <!-- BLUR WINDOW LIST -->\n        <key type=\"b\" name=\"blur-window-list\">\n            <default>true</default>\n            <summary>Boolean, whether to blur window list extension or not</summary>\n            <description />\n        </key>\n        <!-- HACKS LEVEL -->\n        <key type=\"i\" name=\"hacks-level\">\n            <default>1</default>\n            <summary>Level of hacks to use (from 0 to 2)</summary>\n            <description />\n        </key>\n        <!-- DASH OPACITY -->\n        <key type=\"d\" name=\"dash-opacity\">\n            <default>0.12</default>\n            <summary>Opacity of dash to use</summary>\n            <description />\n        </key>\n        <!-- APPFOLDER DIALOG OPACITY -->\n        <key type=\"d\" name=\"appfolder-dialog-opacity\">\n            <default>0.12</default>\n            <summary>Opacity of appfolder dialog to use</summary>\n            <description />\n        </key>\n        <!-- STATIC BLUR -->\n        <key type=\"b\" name=\"static-blur\">\n            <default>true</default>\n            <summary>Boolean, whether to have a static blur on panel or a dynamic one</summary>\n            <description />\n        </key>\n        <!-- HIDETOPBAR -->\n        <key type=\"b\" name=\"hidetopbar\">\n            <default>false</default>\n            <summary>Boolean, whether to try compatibility with hidetopbar@mathieu.bidon.ca or not</summary>\n            <description />\n        </key>\n        <!-- DEBUG -->\n        <key type=\"b\" name=\"debug\">\n            <default>false</default>\n            <summary>Boolean, set to true to activate debug mode (more verbose journalctl logs)</summary>\n            <description />\n        </key>\n    </schema>\n</schemalist>\n"
  },
  {
    "path": "src/settings.js",
    "content": "'use strict';\n\nconst Gio = imports.gi.Gio;\nconst Extension = imports.misc.extensionUtils.getCurrentExtension();\n\nconst SCHEMA_PATH = 'org.gnome.shell.extensions.blur-me';\n\nfunction get_local_gsettings(schema_path) {\n    const GioSSS = Gio.SettingsSchemaSource;\n    let schemaDir = Extension.dir.get_child('schemas');\n    let schemaSource = GioSSS.get_default();\n\n    if (schemaDir.query_exists(null)) {\n        schemaSource = GioSSS.new_from_directory(\n            schemaDir.get_path(),\n            schemaSource,\n            false);\n    }\n\n    let schemaObj = schemaSource.lookup(schema_path, true);\n    if (!schemaObj) {\n        throw new Error(\n            `Schema ${schema_path} could not be found for extension ${Extension.metadata.uuid}`\n        );\n    }\n    return new Gio.Settings({\n        settings_schema: schemaObj\n    });\n};\n\nvar Prefs = class Prefs {\n    constructor() {\n        var settings = this.settings = get_local_gsettings(SCHEMA_PATH);\n        this.SIGMA = {\n            key: 'sigma',\n            get: function () {\n                return settings.get_int(this.key);\n            },\n            set: function (v) {\n                settings.set_int(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            },\n        };\n\n        this.WINDOW_CLASS_OVERRIDES = {\n            key: 'window-class-overrides',\n            get: function () {\n                try {\n                    return JSON.parse(settings.get_string(this.key));\n                } catch(e){\n                    return {};\n                }\n            },\n            set: function (v) {\n                settings.set_string(this.key, JSON.stringify(v));\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            },\n        };\n\n        this.BRIGHTNESS = {\n            key: 'brightness',\n            get: function () {\n                return settings.get_double(this.key);\n            },\n            set: function (v) {\n                settings.set_double(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            },\n        };\n\n        this.BLUR_DASH = {\n            key: 'blur-dash',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n\n        this.BLUR_PANEL = {\n            key: 'blur-panel',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n\n        this.BLUR_OVERVIEW = {\n            key: 'blur-overview',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n\n        this.BLUR_LOCKSCREEN = {\n            key: 'blur-lockscreen',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n        \n        this.BLUR_APPFOLDERS = {\n            key: 'blur-appfolders',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n\n        this.BLUR_WINDOW_LIST = {\n            key: 'blur-window-list',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n\n        this.BLUR_APPLICATIONS = {\n          key: 'blur-applications',\n          get: function () {\n              return settings.get_boolean(this.key);\n          },\n          set: function (v) {\n              settings.set_boolean(this.key, v);\n          },\n          changed: function (cb) {\n              return settings.connect('changed::' + this.key, cb);\n          },\n          disconnect: function () {\n              return settings.disconnect.apply(settings, arguments);\n          }\n        };\n\n        this.BLUR_OTHER = {\n            key: 'blur-other',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n          };\n\n        this.TOGGLE_APP_BLUR = {\n            key: 'toggle-app-blur',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n          };\n\n        this.HACKS_LEVEL = {\n            key: 'hacks-level',\n            get: function () {\n                return settings.get_int(this.key);\n            },\n            set: function (v) {\n                settings.set_int(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            },\n        };\n\n        this.DASH_OPACITY = {\n            key: 'dash-opacity',\n            get: function () {\n                return settings.get_double(this.key);\n            },\n            set: function (v) {\n                settings.set_double(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            },\n        };\n\n        this.APPFOLDER_DIALOG_OPACITY = {\n            key: 'appfolder-dialog-opacity',\n            get: function () {\n                return settings.get_double(this.key);\n            },\n            set: function (v) {\n                settings.set_double(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            },\n        };\n\n        this.STATIC_BLUR = {\n            key: 'static-blur',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n\n        this.HIDETOPBAR = {\n            key: 'hidetopbar',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n\n        this.DEBUG = {\n            key: 'debug',\n            get: function () {\n                return settings.get_boolean(this.key);\n            },\n            set: function (v) {\n                settings.set_boolean(this.key, v);\n            },\n            changed: function (cb) {\n                return settings.connect('changed::' + this.key, cb);\n            },\n            disconnect: function () {\n                return settings.disconnect.apply(settings, arguments);\n            }\n        };\n    }\n};\n"
  },
  {
    "path": "src/stylesheet.css",
    "content": "#panel.transparent-panel {\n    background: transparent;\n    transition-duration: 500ms;\n}\n\n.blurred-overview .app-folder {\n    background-color: rgba(0, 0, 0, 0.12);\n}\n\n.blurred-overview .workspace-animation {\n    background-color: transparent !important;\n}\n\n.transparent-app-folder-dialogs .edit-folder-button {\n    background: transparent;\n    border-radius: 19px;\n}\n\n.blurred-dash .dash-background {\n    background: transparent;\n}\n\n/*\n! TRANSPARENT APPFOLDER DIALOGS\n\npython generator:\n\n```py\nfor e in range(0,101):print(\".transparent-app-folder-dialogs-\"+str(e)+\"\\n{background-color: rgba(0, 0, 0, \"+str(round(e/100,2))+\");}\")\n```\n*/\n\n.transparent-app-folder-dialogs-0 {\n    background-color: rgba(0, 0, 0, 0.0);\n}\n\n.transparent-app-folder-dialogs-1 {\n    background-color: rgba(0, 0, 0, 0.01);\n}\n\n.transparent-app-folder-dialogs-2 {\n    background-color: rgba(0, 0, 0, 0.02);\n}\n\n.transparent-app-folder-dialogs-3 {\n    background-color: rgba(0, 0, 0, 0.03);\n}\n\n.transparent-app-folder-dialogs-4 {\n    background-color: rgba(0, 0, 0, 0.04);\n}\n\n.transparent-app-folder-dialogs-5 {\n    background-color: rgba(0, 0, 0, 0.05);\n}\n\n.transparent-app-folder-dialogs-6 {\n    background-color: rgba(0, 0, 0, 0.06);\n}\n\n.transparent-app-folder-dialogs-7 {\n    background-color: rgba(0, 0, 0, 0.07);\n}\n\n.transparent-app-folder-dialogs-8 {\n    background-color: rgba(0, 0, 0, 0.08);\n}\n\n.transparent-app-folder-dialogs-9 {\n    background-color: rgba(0, 0, 0, 0.09);\n}\n\n.transparent-app-folder-dialogs-10 {\n    background-color: rgba(0, 0, 0, 0.1);\n}\n\n.transparent-app-folder-dialogs-11 {\n    background-color: rgba(0, 0, 0, 0.11);\n}\n\n.transparent-app-folder-dialogs-12 {\n    background-color: rgba(0, 0, 0, 0.12);\n}\n\n.transparent-app-folder-dialogs-13 {\n    background-color: rgba(0, 0, 0, 0.13);\n}\n\n.transparent-app-folder-dialogs-14 {\n    background-color: rgba(0, 0, 0, 0.14);\n}\n\n.transparent-app-folder-dialogs-15 {\n    background-color: rgba(0, 0, 0, 0.15);\n}\n\n.transparent-app-folder-dialogs-16 {\n    background-color: rgba(0, 0, 0, 0.16);\n}\n\n.transparent-app-folder-dialogs-17 {\n    background-color: rgba(0, 0, 0, 0.17);\n}\n\n.transparent-app-folder-dialogs-18 {\n    background-color: rgba(0, 0, 0, 0.18);\n}\n\n.transparent-app-folder-dialogs-19 {\n    background-color: rgba(0, 0, 0, 0.19);\n}\n\n.transparent-app-folder-dialogs-20 {\n    background-color: rgba(0, 0, 0, 0.2);\n}\n\n.transparent-app-folder-dialogs-21 {\n    background-color: rgba(0, 0, 0, 0.21);\n}\n\n.transparent-app-folder-dialogs-22 {\n    background-color: rgba(0, 0, 0, 0.22);\n}\n\n.transparent-app-folder-dialogs-23 {\n    background-color: rgba(0, 0, 0, 0.23);\n}\n\n.transparent-app-folder-dialogs-24 {\n    background-color: rgba(0, 0, 0, 0.24);\n}\n\n.transparent-app-folder-dialogs-25 {\n    background-color: rgba(0, 0, 0, 0.25);\n}\n\n.transparent-app-folder-dialogs-26 {\n    background-color: rgba(0, 0, 0, 0.26);\n}\n\n.transparent-app-folder-dialogs-27 {\n    background-color: rgba(0, 0, 0, 0.27);\n}\n\n.transparent-app-folder-dialogs-28 {\n    background-color: rgba(0, 0, 0, 0.28);\n}\n\n.transparent-app-folder-dialogs-29 {\n    background-color: rgba(0, 0, 0, 0.29);\n}\n\n.transparent-app-folder-dialogs-30 {\n    background-color: rgba(0, 0, 0, 0.3);\n}\n\n.transparent-app-folder-dialogs-31 {\n    background-color: rgba(0, 0, 0, 0.31);\n}\n\n.transparent-app-folder-dialogs-32 {\n    background-color: rgba(0, 0, 0, 0.32);\n}\n\n.transparent-app-folder-dialogs-33 {\n    background-color: rgba(0, 0, 0, 0.33);\n}\n\n.transparent-app-folder-dialogs-34 {\n    background-color: rgba(0, 0, 0, 0.34);\n}\n\n.transparent-app-folder-dialogs-35 {\n    background-color: rgba(0, 0, 0, 0.35);\n}\n\n.transparent-app-folder-dialogs-36 {\n    background-color: rgba(0, 0, 0, 0.36);\n}\n\n.transparent-app-folder-dialogs-37 {\n    background-color: rgba(0, 0, 0, 0.37);\n}\n\n.transparent-app-folder-dialogs-38 {\n    background-color: rgba(0, 0, 0, 0.38);\n}\n\n.transparent-app-folder-dialogs-39 {\n    background-color: rgba(0, 0, 0, 0.39);\n}\n\n.transparent-app-folder-dialogs-40 {\n    background-color: rgba(0, 0, 0, 0.4);\n}\n\n.transparent-app-folder-dialogs-41 {\n    background-color: rgba(0, 0, 0, 0.41);\n}\n\n.transparent-app-folder-dialogs-42 {\n    background-color: rgba(0, 0, 0, 0.42);\n}\n\n.transparent-app-folder-dialogs-43 {\n    background-color: rgba(0, 0, 0, 0.43);\n}\n\n.transparent-app-folder-dialogs-44 {\n    background-color: rgba(0, 0, 0, 0.44);\n}\n\n.transparent-app-folder-dialogs-45 {\n    background-color: rgba(0, 0, 0, 0.45);\n}\n\n.transparent-app-folder-dialogs-46 {\n    background-color: rgba(0, 0, 0, 0.46);\n}\n\n.transparent-app-folder-dialogs-47 {\n    background-color: rgba(0, 0, 0, 0.47);\n}\n\n.transparent-app-folder-dialogs-48 {\n    background-color: rgba(0, 0, 0, 0.48);\n}\n\n.transparent-app-folder-dialogs-49 {\n    background-color: rgba(0, 0, 0, 0.49);\n}\n\n.transparent-app-folder-dialogs-50 {\n    background-color: rgba(0, 0, 0, 0.5);\n}\n\n.transparent-app-folder-dialogs-51 {\n    background-color: rgba(0, 0, 0, 0.51);\n}\n\n.transparent-app-folder-dialogs-52 {\n    background-color: rgba(0, 0, 0, 0.52);\n}\n\n.transparent-app-folder-dialogs-53 {\n    background-color: rgba(0, 0, 0, 0.53);\n}\n\n.transparent-app-folder-dialogs-54 {\n    background-color: rgba(0, 0, 0, 0.54);\n}\n\n.transparent-app-folder-dialogs-55 {\n    background-color: rgba(0, 0, 0, 0.55);\n}\n\n.transparent-app-folder-dialogs-56 {\n    background-color: rgba(0, 0, 0, 0.56);\n}\n\n.transparent-app-folder-dialogs-57 {\n    background-color: rgba(0, 0, 0, 0.57);\n}\n\n.transparent-app-folder-dialogs-58 {\n    background-color: rgba(0, 0, 0, 0.58);\n}\n\n.transparent-app-folder-dialogs-59 {\n    background-color: rgba(0, 0, 0, 0.59);\n}\n\n.transparent-app-folder-dialogs-60 {\n    background-color: rgba(0, 0, 0, 0.6);\n}\n\n.transparent-app-folder-dialogs-61 {\n    background-color: rgba(0, 0, 0, 0.61);\n}\n\n.transparent-app-folder-dialogs-62 {\n    background-color: rgba(0, 0, 0, 0.62);\n}\n\n.transparent-app-folder-dialogs-63 {\n    background-color: rgba(0, 0, 0, 0.63);\n}\n\n.transparent-app-folder-dialogs-64 {\n    background-color: rgba(0, 0, 0, 0.64);\n}\n\n.transparent-app-folder-dialogs-65 {\n    background-color: rgba(0, 0, 0, 0.65);\n}\n\n.transparent-app-folder-dialogs-66 {\n    background-color: rgba(0, 0, 0, 0.66);\n}\n\n.transparent-app-folder-dialogs-67 {\n    background-color: rgba(0, 0, 0, 0.67);\n}\n\n.transparent-app-folder-dialogs-68 {\n    background-color: rgba(0, 0, 0, 0.68);\n}\n\n.transparent-app-folder-dialogs-69 {\n    background-color: rgba(0, 0, 0, 0.69);\n}\n\n.transparent-app-folder-dialogs-70 {\n    background-color: rgba(0, 0, 0, 0.7);\n}\n\n.transparent-app-folder-dialogs-71 {\n    background-color: rgba(0, 0, 0, 0.71);\n}\n\n.transparent-app-folder-dialogs-72 {\n    background-color: rgba(0, 0, 0, 0.72);\n}\n\n.transparent-app-folder-dialogs-73 {\n    background-color: rgba(0, 0, 0, 0.73);\n}\n\n.transparent-app-folder-dialogs-74 {\n    background-color: rgba(0, 0, 0, 0.74);\n}\n\n.transparent-app-folder-dialogs-75 {\n    background-color: rgba(0, 0, 0, 0.75);\n}\n\n.transparent-app-folder-dialogs-76 {\n    background-color: rgba(0, 0, 0, 0.76);\n}\n\n.transparent-app-folder-dialogs-77 {\n    background-color: rgba(0, 0, 0, 0.77);\n}\n\n.transparent-app-folder-dialogs-78 {\n    background-color: rgba(0, 0, 0, 0.78);\n}\n\n.transparent-app-folder-dialogs-79 {\n    background-color: rgba(0, 0, 0, 0.79);\n}\n\n.transparent-app-folder-dialogs-80 {\n    background-color: rgba(0, 0, 0, 0.8);\n}\n\n.transparent-app-folder-dialogs-81 {\n    background-color: rgba(0, 0, 0, 0.81);\n}\n\n.transparent-app-folder-dialogs-82 {\n    background-color: rgba(0, 0, 0, 0.82);\n}\n\n.transparent-app-folder-dialogs-83 {\n    background-color: rgba(0, 0, 0, 0.83);\n}\n\n.transparent-app-folder-dialogs-84 {\n    background-color: rgba(0, 0, 0, 0.84);\n}\n\n.transparent-app-folder-dialogs-85 {\n    background-color: rgba(0, 0, 0, 0.85);\n}\n\n.transparent-app-folder-dialogs-86 {\n    background-color: rgba(0, 0, 0, 0.86);\n}\n\n.transparent-app-folder-dialogs-87 {\n    background-color: rgba(0, 0, 0, 0.87);\n}\n\n.transparent-app-folder-dialogs-88 {\n    background-color: rgba(0, 0, 0, 0.88);\n}\n\n.transparent-app-folder-dialogs-89 {\n    background-color: rgba(0, 0, 0, 0.89);\n}\n\n.transparent-app-folder-dialogs-90 {\n    background-color: rgba(0, 0, 0, 0.9);\n}\n\n.transparent-app-folder-dialogs-91 {\n    background-color: rgba(0, 0, 0, 0.91);\n}\n\n.transparent-app-folder-dialogs-92 {\n    background-color: rgba(0, 0, 0, 0.92);\n}\n\n.transparent-app-folder-dialogs-93 {\n    background-color: rgba(0, 0, 0, 0.93);\n}\n\n.transparent-app-folder-dialogs-94 {\n    background-color: rgba(0, 0, 0, 0.94);\n}\n\n.transparent-app-folder-dialogs-95 {\n    background-color: rgba(0, 0, 0, 0.95);\n}\n\n.transparent-app-folder-dialogs-96 {\n    background-color: rgba(0, 0, 0, 0.96);\n}\n\n.transparent-app-folder-dialogs-97 {\n    background-color: rgba(0, 0, 0, 0.97);\n}\n\n.transparent-app-folder-dialogs-98 {\n    background-color: rgba(0, 0, 0, 0.98);\n}\n\n.transparent-app-folder-dialogs-99 {\n    background-color: rgba(0, 0, 0, 0.99);\n}\n\n.transparent-app-folder-dialogs-100 {\n    background-color: rgba(0, 0, 0, 1.0);\n}"
  },
  {
    "path": "src/utilities.js",
    "content": "\"use strict\";\nconst { GLib } = imports.gi;\n\nlet clearTimeout, clearInterval;\nclearInterval = clearTimeout = GLib.Source.remove;\n\nvar setTimeout = function(func, delay, ...args) {\n    return GLib.timeout_add(GLib.PRIORITY_DEFAULT, delay, () => {\n        func(...args);\n        return GLib.SOURCE_REMOVE;\n    });\n};\n\nvar setInterval = function(func, delay, ...args) {\n    return GLib.timeout_add(GLib.PRIORITY_DEFAULT, delay, () => {\n        func(...args);\n        return GLib.SOURCE_CONTINUE;\n    });\n};\n\nconst get_process_name_from_window = function (v) {\n  try {\n    let pwithnew = GLib.spawn_command_line_sync(\n      `ps -p ${v.get_pid()} -o comm=`\n    )[1]+\"\";\n    return pwithnew.replace(/\\n/g, \"\");\n  } catch (e) {\n    return \"\";\n  }\n}\n\nvar easeOutQuad = function(t, begin, end, duration) {\n    t /= duration\n    return begin + (t * (2 - t) * (end - begin))\n};\n\nvar ease_property = function(object, property, begin, end, duration, update) {\n    let start = Date.now();\n    GLib.timeout_add(GLib.PRIORITY_DEFAULT, update, () => {\n        let time = Date.now() - start;\n        if (time < duration) {\n            object[property] = easeOutQuad(time, begin, end, duration);\n            return GLib.SOURCE_CONTINUE;\n        } else {\n            object[property] = end;\n            return GLib.SOURCE_REMOVE;\n        }\n    });\n};"
  },
  {
    "path": "src/window_list.js",
    "content": "'use strict';\n\nconst { St, Shell, Meta, Gio } = imports.gi;\nconst Main = imports.ui.main;\n\nconst Me = imports.misc.extensionUtils.getCurrentExtension();\nconst Settings = Me.imports.settings;\nconst Utils = Me.imports.utilities;\nconst PaintSignals = Me.imports.paint_signals;\n\n\nvar WindowListBlur = class WindowListBlur {\n    constructor(connections, prefs) {\n        this.connections = connections;\n        this.prefs = prefs;\n        this.paint_signals = new PaintSignals.PaintSignals(connections);\n        this.blur_effects = [];\n    }\n\n    enable() {\n        this._log(\"blurring window list\");\n\n        // add the blur if window-list found\n        Main.layoutManager.uiGroup.get_children().forEach(child => this.try_blur(child));\n\n        // listen to new actors in `Main.layoutManager.uiGroup` and blur if window-list\n        this.connections.connect(Main.layoutManager.uiGroup, 'actor-added', (_, child) => this.try_blur(child));\n\n        // connect to overview\n        this.connections.connect(Main.overview, 'showing', () => {\n            this.hide();\n        });\n        this.connections.connect(Main.overview, 'hidden', () => {\n            this.show();\n        });\n    }\n\n    try_blur(child) {\n        if (child.constructor.name == \"WindowList\" && child.style != \"background:transparent;\") {\n            this._log(\"found window list to blur\");\n\n            child.style = \"background:transparent;\";\n            let effect = new Shell.BlurEffect({\n                name: 'window-list-blur',\n                sigma: this.prefs.SIGMA.get(),\n                brightness: this.prefs.BRIGHTNESS.get(),\n                mode: 1\n            });\n            child.add_effect(effect);\n            this.blur_effects.push(effect);\n\n            // ! DIRTY PART: hack because `Shell.BlurEffect` does not repaint when shadows are under it\n            // ! this does not entirely fix this bug (shadows caused by windows still cause artefacts)\n            // ! but it prevents the shadows of the panel buttons to cause artefacts on the panel itself\n            // ! note: issue opened at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2857\n\n            if (this.prefs.HACKS_LEVEL.get() == 1) {\n                this._log(\"window list hack level 1\");\n\n                child._windowList.get_children().forEach(child => {\n                    this.connections.connect(child, 'button-press-event', () => { effect.queue_repaint(); });\n                });\n            } else if (this.prefs.HACKS_LEVEL.get() == 2) {\n                this._log(\"window list hack level 2\");\n\n                this.paint_signals.connect(child, effect);\n            } else {\n                this.paint_signals.disconnect_all();\n            }\n\n            // ! END OF DIRTY PART\n\n            child._windowList.get_children().forEach(window => this.blur_window_button(window));\n            this.connections.connect(child._windowList, 'actor-added', (_, window) => {\n                this.blur_window_button(window);\n            })\n        }\n    }\n\n    blur_window_button(window) {\n        window.get_child_at_index(0).style = \"box-shadow:none;background-color:rgba(0,0,0,0.2);border-radius:5px;\";\n    }\n\n    try_remove_blur(child) {\n        if (child.constructor.name == \"WindowList\" && child.style == \"background:transparent;\") {\n            child.style = null;\n            child.remove_effect_by_name('window-list-blur');\n\n            child._windowList.get_children().forEach(child => {\n                child.get_child_at_index(0).style = null;\n            });\n        }\n    }\n\n    set_sigma(s) {\n        this.blur_effects.forEach(effect => {\n            effect.sigma = s;\n        });\n    }\n\n    set_brightness(b) {\n        this.blur_effects.forEach(effect => {\n            effect.brightness = b;\n        });\n    }\n\n    hide() {\n        this.set_sigma(0);\n    }\n\n    show() {\n        this.set_sigma(this.prefs.SIGMA.get());\n    }\n\n    disable() {\n        this._log(\"removing blur from window list\");\n\n        Main.layoutManager.uiGroup.get_children().forEach(child => this.try_remove_blur(child))\n\n        this.blur_effects = [];\n        this.connections.disconnect_all();\n    }\n\n    _log(str) {\n        if (this.prefs.DEBUG.get())\n            log(`[Blur my Shell] ${str}`)\n    }\n}"
  }
]